866ddf3bea
there is an issue with south and sqlite - it doesn't handle migrations that add BooleanField columns with defaults. just use the faults script to set the flags to their correct default after migrating with south.
54 lines
1.6 KiB
Python
54 lines
1.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
from django import forms
|
|
|
|
from .models import Host, Domain, ServiceUpdaterHostConfig
|
|
|
|
|
|
class CreateHostForm(forms.ModelForm):
|
|
class Meta(object):
|
|
model = Host
|
|
fields = ['subdomain', 'domain', 'comment']
|
|
widgets = {
|
|
'subdomain': forms.widgets.TextInput(attrs=dict(autofocus=None)),
|
|
}
|
|
|
|
|
|
class EditHostForm(forms.ModelForm):
|
|
class Meta(object):
|
|
model = Host
|
|
fields = ['comment', 'available', 'abuse']
|
|
|
|
|
|
class CreateDomainForm(forms.ModelForm):
|
|
class Meta(object):
|
|
model = Domain
|
|
fields = ['domain', 'nameserver_ip', 'nameserver_update_algorithm',
|
|
'public', 'available', 'comment']
|
|
widgets = {
|
|
'domain': forms.widgets.TextInput(attrs=dict(autofocus=None)),
|
|
}
|
|
|
|
|
|
class EditDomainForm(forms.ModelForm):
|
|
class Meta(object):
|
|
model = Domain
|
|
fields = ['comment', 'nameserver_ip', 'public', 'available',
|
|
'nameserver_update_algorithm', 'nameserver_update_secret']
|
|
|
|
|
|
class CreateUpdaterHostConfigForm(forms.ModelForm):
|
|
class Meta(object):
|
|
model = ServiceUpdaterHostConfig
|
|
fields = ['service', 'hostname', 'name', 'password',
|
|
'give_ipv4', 'give_ipv6', 'comment']
|
|
widgets = {
|
|
'hostname': forms.widgets.TextInput(attrs=dict(autofocus=None)),
|
|
}
|
|
|
|
|
|
class EditUpdaterHostConfigForm(forms.ModelForm):
|
|
class Meta(object):
|
|
model = ServiceUpdaterHostConfig
|
|
fields = ['hostname', 'comment', 'name', 'password',
|
|
'give_ipv4', 'give_ipv6']
|