from extra_views import CreateWithInlinesView, InlineFormSetFactory
class FilesDocumentsInline (InlineFormSetFactory): model = FilesDocuments fields = ['id', 'kynd', 'file_document']
class ContactInline (InlineFormSetFactory): model = Contact fields = ['kynd', 'description', 'contact']
class CreatePerson (CreateWithInlinesView): model = Person inlines = [ContactInline, FilesDocumentsInline] fields = ['name', 'phone', 'cpf_cnpj', 'email', 'birth', 'rg', 'cep', 'backyard', 'number', 'neighborhood', 'city State'] template_name = 'person_create_contact.html'
path ('nova /', views.CreatePerson, name = 'CreatePerson'),
Sorted out!
path('nova/', views.CreatePerson.as_view(), name='CreatePerson'),
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/m7cXAuwS4bQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f7cd09d7-201e-4874-a296-c996569c7b45%40googlegroups.com.