2013-09-28 20:01:09 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from django import forms
|
2013-10-03 19:26:39 +02:00
|
|
|
|
2013-10-18 15:30:17 -07:00
|
|
|
from .models import Host, Domain
|
2013-09-28 20:01:09 +02:00
|
|
|
|
2013-09-29 01:21:44 +02:00
|
|
|
|
2013-09-29 19:58:08 +02:00
|
|
|
class CreateHostForm(forms.ModelForm):
|
2013-10-03 17:21:18 +02:00
|
|
|
class Meta(object):
|
2013-09-28 20:01:09 +02:00
|
|
|
model = Host
|
2013-09-29 19:58:08 +02:00
|
|
|
fields = ['subdomain', 'domain', 'comment']
|
2013-11-01 21:11:57 +01:00
|
|
|
widgets = {
|
|
|
|
'subdomain': forms.widgets.TextInput(attrs=dict(autofocus=None)),
|
|
|
|
}
|
2013-09-29 19:58:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
class EditHostForm(forms.ModelForm):
|
2013-10-03 17:21:18 +02:00
|
|
|
class Meta(object):
|
2013-09-29 19:58:08 +02:00
|
|
|
model = Host
|
|
|
|
fields = ['comment']
|
2013-10-18 15:30:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
class CreateDomainForm(forms.ModelForm):
|
|
|
|
class Meta(object):
|
|
|
|
model = Domain
|
2013-11-24 04:14:31 +01:00
|
|
|
fields = ['domain', 'nameserver_ip', 'nameserver_update_algorithm',
|
|
|
|
'public', 'available', 'comment']
|
2013-11-01 21:11:57 +01:00
|
|
|
widgets = {
|
|
|
|
'domain': forms.widgets.TextInput(attrs=dict(autofocus=None)),
|
|
|
|
}
|
2013-11-02 11:29:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
class EditDomainForm(forms.ModelForm):
|
|
|
|
class Meta(object):
|
|
|
|
model = Domain
|
2013-11-02 12:37:27 +01:00
|
|
|
fields = ['comment', 'nameserver_ip', 'public', 'available',
|
2013-11-24 05:04:07 +01:00
|
|
|
'nameserver_update_algorithm', 'nameserver_update_secret']
|