2 from django import forms
4 from filex.models import Favorite
7 class FavoriteForm(forms.ModelForm):
10 fields = ('owner', 'host', 'path')
11 widgets = {'owner': forms.HiddenInput()}
14 class NewDirForm(forms.Form):
15 host = forms.CharField(label=u'Host', max_length=256, widget=forms.HiddenInput())
16 path = forms.CharField(label=u'Ścieżka', max_length=1024, widget=forms.HiddenInput())
17 name = forms.CharField(label=u'Nazwa', max_length=256)
20 class RenameForm(forms.Form):
21 host = forms.CharField(label=u'Host', max_length=256, widget=forms.HiddenInput())
22 path = forms.CharField(label=u'Ścieżka', max_length=1024, widget=forms.HiddenInput())
23 src = forms.CharField(label=u'Stara nazwa', max_length=256, widget=forms.HiddenInput())
24 dst = forms.CharField(label=u'Nowa nazwa', max_length=256)
27 class ArchiveForm(NewDirForm):
33 (ZIP, 'Archiwum zip'),
34 (GZIP, 'Archiwum tar.gz'),
35 (BZIP, 'Archiwum tar.bz2'),
38 type = forms.ChoiceField(label=u'Typ', choices=TYPE_CHOICES, initial=ZIP)