Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django model and form exemple

# books/models.py
class Book(models.Model):
    title = models.CharField(max_length=100)
    isbn = models.CharField(max_length=100, unique=True)
    is_published = models.BooleanField(default=True)

    def __str__(self):
        return self.title

# books/forms.py
class BookCreateForm(forms.ModelForm):
    class Meta:
        model = Book
Source by www.agiliq.com #
 
PREVIOUS NEXT
Tagged: #django #model #form #exemple
ADD COMMENT
Topic
Name
5+2 =