Thomas Waldmann 7436a8b578 add autofocussed fields
TODO: autofocus for registration / login views
2013-11-01 21:11:57 +01:00

29 lines
670 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
exclude = ['created_by']
widgets = {
'domain': forms.widgets.TextInput(attrs=dict(autofocus=None)),
}