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()
12 class ImageFoldersForm(forms.Form):
13 folders = forms.ChoiceField(required=False)
15 def __init__(self, *args, **kwargs):
16 super(ImageFoldersForm, self).__init__(*args, **kwargs)
17 self.fields['folders'].choices = [('', '-- Wybierz folder z obrazkami --')] + [(fn, fn) for fn in models.get_image_folders()]