# coding=utf-8
from django import forms
+from filex.models import Favorite
+
+
+class FavoriteForm(forms.ModelForm):
+ class Meta:
+ model = Favorite
+ fields = ('owner', 'host', 'path')
+ widgets = {'owner': forms.HiddenInput()}
+
class NewDirForm(forms.Form):
host = forms.CharField(label=u'Host', max_length=256, widget=forms.HiddenInput())
path = forms.CharField(label=u'Ścieżka', max_length=1024, widget=forms.HiddenInput())
src = forms.CharField(label=u'Stara nazwa', max_length=256, widget=forms.HiddenInput())
dst = forms.CharField(label=u'Nowa nazwa', max_length=256)
+
+
+class ArchiveForm(NewDirForm):
+ ZIP = '.zip'
+ GZIP = '.tar.gz'
+ BZIP = '.tar.bz2'
+
+ TYPE_CHOICES = (
+ (ZIP, 'Archiwum zip'),
+ (GZIP, 'Archiwum tar.gz'),
+ (BZIP, 'Archiwum tar.bz2'),
+ )
+
+ type = forms.ChoiceField(label=u'Typ', choices=TYPE_CHOICES, initial=ZIP)