Thomas Waldmann d9e9c66319 service updater host configuration: added user interface
this is the ui USERS need to configure sending updates to an ALREADY CONFIGURED service.

there is no UI yet for creating a new service, the ADMIN has to use django admin for that.
2013-11-29 10:43:18 +01:00

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']
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']