Feat(SQL, UI): Redesign database with much more detailed command response quality analysis and created successfully loading Dog Command Links page
This commit is contained in:
@@ -11,9 +11,12 @@ Defines Flask-WTF base forms for handling user input.
|
||||
"""
|
||||
|
||||
# internal
|
||||
from dog_training.helpers.helper_app import Helper_App
|
||||
# external
|
||||
from flask_wtf import FlaskForm
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from wtforms import SelectField, BooleanField, SubmitField
|
||||
from wtforms.validators import InputRequired, NumberRange, Regexp, DataRequired, Optional
|
||||
|
||||
|
||||
class Form_Base_Meta(type(FlaskForm), ABCMeta):
|
||||
@@ -21,45 +24,30 @@ class Form_Base_Meta(type(FlaskForm), ABCMeta):
|
||||
|
||||
|
||||
class Form_Base(FlaskForm, metaclass=Form_Base_Meta):
|
||||
"""
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def from_filters(cls, filters):
|
||||
pass
|
||||
@abstractmethod
|
||||
def __repr__(self):
|
||||
pass
|
||||
"""
|
||||
def from_json(cls, json):
|
||||
Helper_App.console_log(f'Error: Parent classes of {cls.__qualname__} must define cls.from_json')
|
||||
|
||||
@classmethod
|
||||
def get_default(cls):
|
||||
return cls()
|
||||
@classmethod
|
||||
def get_select_option_blank(cls):
|
||||
return (cls.get_select_option_default_value(), 'Select')
|
||||
@classmethod
|
||||
def get_select_option_all(cls):
|
||||
return (cls.get_select_option_default_value(), 'All')
|
||||
|
||||
@staticmethod
|
||||
def get_select_option_default_value():
|
||||
return ''
|
||||
|
||||
def __repr__(self):
|
||||
fields = ', '.join(
|
||||
f"{name}={field.data}" for name, field in self._fields.items()
|
||||
)
|
||||
return f"{self.__class__.__name__}({fields})"
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def from_json(cls, json):
|
||||
pass
|
||||
@classmethod
|
||||
def get_default(cls):
|
||||
return cls()
|
||||
"""
|
||||
@abstractmethod
|
||||
def test_69(self):
|
||||
pass
|
||||
|
||||
def get_Filters_Product_Category(data_request):
|
||||
data_form = data_request[Model_View_Store_Product_Category.FLAG_FORM]
|
||||
form_filters = Filters_Product_Category(**data_form)
|
||||
form_filters.is_not_empty.data = av.input_bool(data_form['is_not_empty'], 'is_not_empty', 'filter_category')
|
||||
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):
|
||||
@@ -75,4 +63,10 @@ class Filters_Stored_Procedure_Base(Form_Base):
|
||||
@abstractmethod
|
||||
def to_json(self):
|
||||
pass
|
||||
'''
|
||||
'''
|
||||
|
||||
|
||||
|
||||
class Form_Filters_User(FlaskForm):
|
||||
active = BooleanField('Active only?', default = True)
|
||||
id_user = SelectField('User ID', validators=[Optional()], choices=[])
|
||||
Reference in New Issue
Block a user