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