35 lines
872 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from django import forms
from .models import Host, Domain
2013-09-29 01:21:44 +02:00
class CreateHostForm(forms.ModelForm):
2013-10-03 17:21:18 +02:00
class Meta(object):
model = Host
fields = ['subdomain', 'domain', 'comment']
widgets = {
'subdomain': forms.widgets.TextInput(attrs=dict(autofocus=None)),
}
class EditHostForm(forms.ModelForm):
2013-10-03 17:21:18 +02:00
class Meta(object):
model = Host
fields = ['comment']
class CreateDomainForm(forms.ModelForm):
class Meta(object):
model = Domain
exclude = ['created_by']
widgets = {
'domain': forms.widgets.TextInput(attrs=dict(autofocus=None)),
}
class EditDomainForm(forms.ModelForm):
class Meta(object):
model = Domain
fields = ['nameserver_ip', 'public', 'available', 'nameserver_update_algorithm', 'nameserver_update_key']