1 from django import forms |
|
2 from models import Project, Content |
|
3 import uuid |
|
4 |
|
5 class LdtImportForm(forms.Form): |
|
6 importFile = forms.FileField() |
|
7 videoPath = forms.CharField(required=False) |
|
8 flatten = forms.BooleanField(required=False, initial=True) |
|
9 |
|
10 class LdtAddForm(forms.ModelForm): |
|
11 title = forms.CharField() |
|
12 # contents = forms.ModelMultipleChoiceField(Content.objects.all()) |
|
13 # owner = forms.ModelChoiceField(Author.objects.all()) |
|
14 class Meta: |
|
15 model = Project |
|
16 exclude = ("ldt_id", "ldt", "created_by", "changed_by", "creation_date", "modification_date", "state", "owner") |
|
17 |
|
18 class ReindexForm(forms.Form): |
|
19 contents = forms.ModelMultipleChoiceField(Content.objects.all()) |
|
20 |
|
21 class SearchForm(forms.Form): |
|
22 search = forms.CharField() |
|
23 field = forms.ChoiceField([(u"all", u"all"), (u"title", u"title"), (u"abstract", u"resume"), (u"tags", u"tags")]) |
|
24 |
|
25 class AddProjectForm (forms.Form): |
|
26 title = forms.CharField() |
|
27 |
|
28 class CopyProjectForm (forms.Form): |
|
29 title = forms.CharField() |
|