diff options
Diffstat (limited to 'coip/apps/name/forms.py')
-rw-r--r-- | coip/apps/name/forms.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/coip/apps/name/forms.py b/coip/apps/name/forms.py index 9dd03a7..a2a659e 100644 --- a/coip/apps/name/forms.py +++ b/coip/apps/name/forms.py @@ -5,7 +5,8 @@ Created on Jun 24, 2010 ''' from django import forms from coip.apps.name.models import Name, Attribute, NameLink -from django.forms.fields import BooleanField +from django.forms import fields +from django.forms.widgets import HiddenInput, CheckboxSelectMultiple class NameForm(forms.ModelForm): class Meta: @@ -16,20 +17,20 @@ class AttributeForm(forms.ModelForm): model = Attribute class NameEditForm(forms.ModelForm): - description = forms.CharField(widget=forms.Textarea(attrs={'cols': 85, 'rows': 10})) + description = forms.CharField(widget=forms.Textarea(attrs={'cols': 60, 'rows': 6})) class Meta: model = Name fields = ['short','description'] class NewNameForm(forms.ModelForm): - description = forms.CharField(widget=forms.Textarea(attrs={'cols': 85, 'rows': 10})) + description = forms.CharField(widget=forms.Textarea(attrs={'cols': 60, 'rows': 6})) class Meta: model = Name fields = ['type','value','short','description'] class NameDeleteForm(forms.Form): - recursive = BooleanField(label="Also delete everything below this name?",required=False) + recursive = fields.BooleanField(label="Also delete everything below this name?",required=False) class NameLinkForm(forms.ModelForm): class Meta: @@ -37,4 +38,9 @@ class NameLinkForm(forms.ModelForm): fields = ['dst','type','data'] class NameLinkDeleteForm(forms.Form): - confirm = BooleanField(label="Confirm")
\ No newline at end of file + confirm = fields.BooleanField(label="Confirm") + +class PermissionForm(forms.Form): + dst = fields.IntegerField(widget=HiddenInput) + subject = fields.CharField(min_length=1024) + permissions = fields.MultipleChoiceField(widget=CheckboxSelectMultiple,choices=[('r','read'),('w','write'),('l','list'),('i','insert'),('d','delete')]) |