feat(web): Store Product UI created and hooked up for viewing, editing, and saving.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -40,9 +40,8 @@ class Form_Base(FlaskForm, metaclass=Form_Base_Meta):
|
||||
def from_json(cls, json):
|
||||
pass
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def get_default(cls):
|
||||
pass
|
||||
return cls()
|
||||
"""
|
||||
@abstractmethod
|
||||
def test_69(self):
|
||||
@@ -55,6 +54,12 @@ class Form_Base(FlaskForm, metaclass=Form_Base_Meta):
|
||||
form_filters.active.data = av.input_bool(data_form['active'], 'active', 'filter_category')
|
||||
return form_filters
|
||||
"""
|
||||
@classmethod
|
||||
def get_choices_blank(cls):
|
||||
return [('', 'Select')]
|
||||
@classmethod
|
||||
def get_choice_all(cls):
|
||||
return ('', 'All')
|
||||
|
||||
'''
|
||||
class Filters_Stored_Procedure_Base(Form_Base):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -22,7 +22,7 @@ from flask_wtf.recaptcha import RecaptchaField
|
||||
|
||||
|
||||
class Filters_Product(FlaskForm):
|
||||
id_category = SelectField('Category', validators=[Optional()], choices=[])
|
||||
id_category = SelectField('Category', validators=[Optional()], choices=[('', 'All')])
|
||||
is_not_empty = BooleanField('Not empty only?')
|
||||
active = BooleanField("Active only?")
|
||||
@classmethod
|
||||
@@ -33,4 +33,11 @@ class Filters_Product(FlaskForm):
|
||||
form.active.data = filters_product.active
|
||||
return form
|
||||
def __repr__(self):
|
||||
return f'Filters_Product(id_category={self.id_category}, is_not_empty={self.is_not_empty.data}, active={self.active.data})'
|
||||
return f'Filters_Product(id_category={self.id_category}, is_not_empty={self.is_not_empty.data}, active={self.active.data})'
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
filters = cls()
|
||||
filters.id_category.data = json['id_category']
|
||||
filters.is_not_empty.data = json['is_not_empty']
|
||||
filters.active.data = json['active']
|
||||
return filters
|
||||
@@ -26,8 +26,8 @@ from abc import ABCMeta, abstractmethod
|
||||
|
||||
|
||||
class Filters_Product_Permutation(Form_Base):
|
||||
id_category = SelectField('Category', validators=[Optional()], choices=[])
|
||||
id_product = SelectField('Product', validators=[Optional()], choices=[])
|
||||
id_category = SelectField('Category', validators=[Optional()], choices=[('', 'All')])
|
||||
id_product = SelectField('Product', validators=[Optional()], choices=[('', 'All')])
|
||||
is_out_of_stock = BooleanField('Out of stock only?')
|
||||
quantity_min = FloatField('Min stock')
|
||||
quantity_max = FloatField('Max stock')
|
||||
|
||||
@@ -64,4 +64,5 @@ class Filters_Stock_Item(Form_Base):
|
||||
@classmethod
|
||||
def get_default(cls):
|
||||
filters = cls()
|
||||
filters.id_category.choices = [('', 'Select category')]
|
||||
filters.id_category.choices = cls.get_choices_blank()
|
||||
filters.id_product.choices = cls.get_choices_blank()
|
||||
Reference in New Issue
Block a user