コード例 #1
0
 def __init__(self, *args, **kwargs):
     super(EquipmentForm, self).__init__(*args, **kwargs)
     simple_form_widget(self=self,
                        field='name',
                        maxlength=50,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter equipment name...')
     simple_form_widget(self=self,
                        field='description',
                        placeholder='Enter description...')
コード例 #2
0
 def __init__(self, *args, **kwargs):
     super(IncidentForm, self).__init__(*args, **kwargs)
     simple_form_widget(self=self,
                        field='title',
                        maxlength=50,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter incident title...')
     simple_form_widget(self=self,
                        field='description',
                        placeholder='Enter description...')
     self.fields['date'].widget.attrs.update({
         'id': 'datepicker2',
         'autocomplete': 'off'
     })
コード例 #3
0
 def __init__(self, *args, **kwargs):
     super(FoodForm, self).__init__(*args, **kwargs)
     simple_form_widget(self=self,
                        field='name',
                        maxlength=50,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter food name...')
     simple_form_widget(self=self,
                        field='description',
                        placeholder='Enter description...')
     self.fields['protein'].help_text = "% per Kilogram (1000 gram)"
     self.fields['carbohydrate'].help_text = "% per Kilogram (1000 gram)"
     self.fields['fat'].help_text = "% per Kilogram (1000 gram)"
     self.fields['vitamin'].help_text = "% per Kilogram (1000 gram)"
     self.fields['mineral'].help_text = "% per Kilogram (1000 gram)"
コード例 #4
0
 def __init__(self, *args, **kwargs):
     super(EquipmentSetForm, self).__init__(*args, **kwargs)
     simple_form_widget(self=self,
                        field='name',
                        maxlength=50,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter equipment name...')
     self.fields['equipments'] = forms.ModelMultipleChoiceField(
         queryset=Equipment.objects.all())
     # self.fields['equipments'] = GroupedModelChoiceField(
     #     queryset=Category.objects.exclude(parent=None),
     #     choices_groupby='parent'
     # )
     self.fields[
         'equipments'].help_text = "Hold down “Control”, or “Command” on a Mac, to select more than one."
     simple_form_widget(self=self,
                        field='description',
                        placeholder='Enter description...')
コード例 #5
0
ファイル: forms.py プロジェクト: NumanIbnMazid/theZoo
 def __init__(self, *args, **kwargs):
     super(AnimalForm, self).__init__(*args, **kwargs)
     simple_form_widget(self=self,
                        field='name',
                        maxlength=50,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter animal name...')
     simple_form_widget(self=self,
                        field='colour',
                        maxlength=50,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter colour...')
     simple_form_widget(self=self,
                        field='weight',
                        step=00.01,
                        pattern="^[0-9.]{1,}$",
                        placeholder='Enter weight (in kg)...')
     self.fields['dob'].widget.attrs.update({
         'id':
         'datetimepicker_DOB',
         'autocomplete':
         'off',
         'placeholder':
         "Select date of birth..."
     })
コード例 #6
0
 def __init__(self, *args, **kwargs):
     super(CageForm, self).__init__(*args, **kwargs)
     simple_form_widget(self=self,
                        field='name',
                        maxlength=50,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter equipment name...')
     simple_form_widget(self=self,
                        field='length',
                        step=00.01,
                        pattern="^[0-9.]{1,}$",
                        placeholder='Enter length (in feet)...')
     simple_form_widget(self=self,
                        field='height',
                        step=00.01,
                        pattern="^[0-9.]{1,}$",
                        placeholder='Enter height (in feet)...')
     simple_form_widget(self=self,
                        field='width',
                        step=00.01,
                        pattern="^[0-9.]{1,}$",
                        placeholder='Enter width (in feet)...')
コード例 #7
0
ファイル: forms.py プロジェクト: NumanIbnMazid/theZoo
 def __init__(self, *args, **kwargs):
     super(SpeciesForm, self).__init__(*args, **kwargs)
     simple_form_widget(self=self,
                        field='name',
                        maxlength=100,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter species name...')
     simple_form_widget(self=self,
                        field='kingdom',
                        maxlength=100,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter kingdom...')
     simple_form_widget(self=self,
                        field='phylum',
                        maxlength=100,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter phylum...')
     simple_form_widget(self=self,
                        field='class_name',
                        maxlength=100,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter class name...')
     simple_form_widget(self=self,
                        field='order',
                        maxlength=100,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter order...')
     simple_form_widget(self=self,
                        field='family',
                        maxlength=100,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter family...')
     simple_form_widget(self=self,
                        field='genus',
                        maxlength=100,
                        pattern="^[_A-z0-9.,# ]{1,}$",
                        placeholder='Enter genus...')