dnmgmt/whoisdb/forms.py

23 lines
552 B
Python
Raw Normal View History

2017-02-23 22:28:06 +01:00
from django import forms
#from crispy_forms.helper import FormHelper
#from crispy_forms.layout import Submit, Layout
#from django.urls import reverse
from .models import Maintainer, Contact
class MntForm(forms.ModelForm):
class Meta:
model = Maintainer
fields = ['handle', 'description']
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ['handle', 'name']
def __init__(self, person=True, *args, **kwargs):
super(ContactForm, self).__init__(*args, **kwargs)
# check if this is a person
self.person = person