972a411ef4
don't ask for the secret in the first form, just autocreate one and show the configuration example with it.
37 lines
996 B
Python
37 lines
996 B
Python
# -*- coding: utf-8 -*-
|
|
from django import forms
|
|
|
|
from .models import Host, Domain
|
|
|
|
|
|
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_key']
|