You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
690 B
Python
24 lines
690 B
Python
from django.forms import ModelForm
|
|
from django.urls import reverse_lazy
|
|
|
|
from preinfo.models import Preinfo
|
|
|
|
|
|
class PreinfoBaseForm(ModelForm):
|
|
class Meta:
|
|
model = Preinfo
|
|
fields = '__all__'
|
|
|
|
# success_url = reverse_lazy('client_preinfo')
|
|
class PreinfoCreateForm(PreinfoBaseForm):
|
|
"""
|
|
Form for creating a new PreinfoModel instance.
|
|
Inherits from PreinfoBaseForm.
|
|
"""
|
|
class Meta(PreinfoBaseForm.Meta):
|
|
exclude = ['created_on',
|
|
'created_by',
|
|
'deleted',
|
|
'deleted_on',
|
|
'deleted_by',
|
|
'received'] # Exclude fields that should not be set by the user |