+class SplitForm(forms.Form):
+ partname = forms.RegexField(regex='[0-9\.\w_-]+', \
+ label='Part name', help_text='Example: rozdziaĆ-2')
+ autoxml = forms.BooleanField(required=False, initial=False, label=u"Split as new publication")
+ fulltext = forms.CharField(widget=forms.HiddenInput(), required=False)
+ splittext = forms.CharField(widget=forms.HiddenInput(), required=False)
+
+class GalleryChoiceForm(forms.ModelForm):
+ subpath = forms.ChoiceField(choices=())
+
+ def __init__(self, *args, **kwargs):
+ super(GalleryChoiceForm, self).__init__(*args, **kwargs)
+ self.fields['subpath'].choices = [(settings.IMAGE_DIR + '/' + x, x) for x in os.listdir(settings.MEDIA_ROOT + settings.IMAGE_DIR)]
+
+ class Meta:
+ model = models.GalleryForDocument
+ fields = ('document', 'subpath',)
+