Merge branch 'master' into 208-edit-course-properties-main
[oweals/karmaworld.git] / karmaworld / apps / notes / forms.py
1 #!/usr/bin/env python
2 # -*- coding:utf8 -*-
3 # Copyright (C) 2012  FinalsClub Foundation
4
5 from django.forms import ModelForm
6 from django.forms import TextInput
7
8 from django_filepicker.forms import FPFileField
9 from django_filepicker.widgets import FPFileWidget
10
11 from karmaworld.apps.notes.models import Note
12
13 class NoteForm(ModelForm):
14     class Meta:
15         model = Note
16         fields = ('name', 'tags', 'year',)
17         widgets = {
18           'name': TextInput()
19         }
20
21 class FileUploadForm(ModelForm):
22     auto_id = False
23     class Meta:
24         model = Note
25         fields = ('fp_file',)
26         widgets = {
27           'fp_file': FPFileWidget(attrs={
28                        'id': 'filepicker-file-upload',
29                      }),
30         }