Answers for "import django form"

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

Python Answers by Framework

Browse Popular Code Answers by Language