1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-09 06:18:05 +00:00

postkey/views.py: use wingets in AddForm

This commit is contained in:
Hidden Z 2010-10-06 19:02:08 +00:00
parent 548ad715aa
commit 17db1b07fd

View File

@ -11,6 +11,11 @@ class AddForm(ModelForm):
class Meta: class Meta:
model = i2phost model = i2phost
fields = ('name', 'b64hash', 'description') fields = ('name', 'b64hash', 'description')
widgets = {
'name': forms.TextInput(attrs={'size': '67'}),
'b64hash': forms.Textarea(attrs={'rows': '1', 'cols': '100'}),
'description': forms.Textarea(attrs={'rows': '2', 'cols': '72'})
}
def clean_name(self): def clean_name(self):
data = self.cleaned_data['name'] data = self.cleaned_data['name']
# convert hostname to lowercase # convert hostname to lowercase