1 from django import forms
3 from explorer import models
6 class BookForm(forms.Form):
7 text = forms.CharField(widget=forms.Textarea)
8 commit_message = forms.CharField()
9 user = forms.CharField()
11 class ImageFoldersForm(forms.Form):
12 folders = forms.ChoiceField(required=False)
14 def __init__(self, *args, **kwargs):
15 super(ImageFoldersForm, self).__init__(*args, **kwargs)
16 self.fields['folders'].choices = [('', '-- Wybierz folder z obrazkami --')] + [(fn, fn) for fn in models.get_image_folders()]