23 lines
552 B
Python
23 lines
552 B
Python
|
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
|