feat(web): Store Product UI created and hooked up for viewing, editing, and saving.

This commit is contained in:
2024-10-05 21:16:42 +01:00
parent f2d20bca58
commit 4000de0fc1
76 changed files with 1154 additions and 1239 deletions

View File

@@ -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