Coverage for book\forms.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-06-29 10:02 +0100

1from django import forms 

2from .models import Book 

3 

4 

5class BookForm(forms.ModelForm): 

6 """ 

7 A form for creating or updating a book. 

8 

9 Inherits from forms.ModelForm and uses the Book model. 

10 The form includes fields for the book's title and author. 

11 """ 

12 

13 class Meta: 

14 """ 

15 The Meta class provides additional information about the form. 

16 It specifies the model to be used and the fields to be included in the 

17 form. 

18 """ 

19 model = Book 

20 fields = ('title', 'author',)