Answers for "django model form import"

3

django model form import

>>> from django.forms import ModelForm
>>> from myapp.models import Article

# Create the form class.
>>> class ArticleForm(ModelForm):
...     class Meta:
...         model = Article
...         fields = ['pub_date', 'headline', 'content', 'reporter']
Posted by: Guest on August-21-2021
5

django model form

class YourForm(ModelForm):
	class Meta:
    	model = YourModel
    	fields = ['pub_date', 'headline', 'content', 'reporter']
Posted by: Guest on October-07-2020

Code answers related to "django model form import"

Python Answers by Framework

Browse Popular Code Answers by Language