-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms.py
32 lines (25 loc) · 913 Bytes
/
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
__author__ = 'Dominic Fitzgerald'
from django import forms
from models import Barcode
from models import Config
class ConfigForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ConfigForm, self).__init__(*args, **kwargs)
for field in self.fields:
self.fields[field].widget.attrs.update({
'class': 'form-control'
})
class Meta:
model = Config
fields = ['runtype', 'read1_cycles', 'read2_cycles', 'barcode_cycles',
'run_name', 'description']
class BarcodeForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(BarcodeForm, self).__init__(*args, **kwargs)
for field in self.fields:
self.fields[field].widget.attrs.update({
'class': 'form-control'
})
class Meta:
model = Barcode
fields = ['name', 'sequence']