forms.py

from django_mongoengine import Document
from django_mongoengine.forms import DocumentForm
from .models import Author, Book

class AuthorForm(DocumentForm):
    class Meta:
        model = Author
        fields = '__all__'

class BookForm(DocumentForm):
    class Meta:
        model = Book
        fields = '__all__'

Last updated