This repository has been archived by the owner on May 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
forms.py
46 lines (38 loc) · 2.02 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from django import forms
from django.forms import ChoiceField,MultipleChoiceField,IntegerField,CharField
class PreviewForm(forms.Form):
def __init__(self, options=None, *args, **kwargs):
super(PreviewForm, self).__init__(*args, **kwargs)
self.fields['preview_annotation'].choices = options
preview_annotation = ChoiceField(choices=(),required=True)
preview_sheet = IntegerField(required=False,min_value=0)
class AnnotationsForm(forms.Form):
def __init__(self, options=None, *args, **kwargs):
super(AnnotationsForm, self).__init__(*args, **kwargs)
self.fields['annotation'].choices = options
annotation = ChoiceField(choices=(),required=True)
header = IntegerField(required=False,min_value=0)
sheet = IntegerField(required=False,min_value=0)
class PlotForm(forms.Form):
def __init__(self, options=None, *args, **kwargs):
super(PlotForm, self).__init__(*args, **kwargs)
self.fields['x_data'].choices = options
self.fields['y_data'].choices = options
title = CharField(max_length=200,required=False)
x_Label = CharField(max_length=50,required=False)
y_Label = CharField(max_length=50,required=False)
#tick_size = IntegerField(required=False,min_value=1)
plot_mode = ChoiceField(choices=(('',''),('bar','bar'),
('lines','line'),\
('markers','markers'),\
('lines+markers','line+markers')),\
required=True)
x_data = ChoiceField(choices=(),required=True)
y_data = MultipleChoiceField(choices=(),required=True)
class PlotUpdateForm(forms.Form):
def __init__(self, options=None, *args, **kwargs):
super(PlotForm, self).__init__(*args, **kwargs)
self.fields['x_update'].choices = options
self.fields['y_update'].choices = options
x_update = ChoiceField(choices=(),required=True)
y_update = MultipleChoiceField(choices=(),required=True)