60 lines
2.2 KiB
Python
60 lines
2.2 KiB
Python
"""
|
|
Project: PARTS Website
|
|
Author: Edward Middleton-Smith
|
|
Precision And Research Technology Systems Limited
|
|
|
|
Technology: View Models
|
|
Feature: Store Parent View Model
|
|
|
|
Description:
|
|
Parent data model for store views
|
|
"""
|
|
|
|
|
|
# internal
|
|
# from context import models
|
|
from business_objects.dog.dog import Dog, Parameters_Dog
|
|
from datastores.datastore_dog import DataStore_Dog
|
|
from helpers.helper_app import Helper_App
|
|
import lib.argument_validation as av
|
|
from models.model_view_base import Model_View_Base
|
|
# external
|
|
from flask import send_file, jsonify
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
import locale
|
|
from typing import ClassVar
|
|
from abc import abstractmethod
|
|
|
|
|
|
class Model_View_Dog_Base(Model_View_Base):
|
|
# ATTR_FORM_TYPE: ClassVar[str] = 'form-type'
|
|
# ATTR_ID_CUSTOMER: ClassVar[str] = 'id-customer'
|
|
# ATTR_ID_CUSTOMER_ADDRESS: ClassVar[str] = Store_Base.ATTR_ID_CUSTOMER_ADDRESS
|
|
# FLAG_CURRENCY_COST: ClassVar[str] = Product_Permutation.FLAG_CURRENCY_COST
|
|
# FLAG_CUSTOMER: ClassVar[str] = Store_Base.FLAG_CUSTOMER
|
|
# FLAG_SYMBOL_UNIT_MEASUREMENT_QUANTITY: ClassVar[str] = Product_Permutation.FLAG_SYMBOL_UNIT_MEASUREMENT_QUANTITY
|
|
# FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED: ClassVar[str] = Product_Permutation.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED
|
|
# HASH_GET_STORE_CUSTOMER_SALES_ORDER: ClassVar[str] = '/store/customer_sales_order_get'
|
|
# HASH_GET_STORE_MANUFACTURING_PURCHASE_ORDER: ClassVar[str] = '/store/manufacturing_purchase_order_get'
|
|
|
|
|
|
@property
|
|
def title(self):
|
|
if self.hash_page_current == Model_View_Base.HASH_PAGE_DOG_HOME:
|
|
return 'Dog Home'
|
|
raise NotImplementedError('title must be implemented in child class')
|
|
|
|
def __init__(self, hash_page_current, **kwargs):
|
|
_m = 'Model_View_Dog_Base.__init__'
|
|
Helper_App.console_log(f'{_m}\nstarting')
|
|
super().__init__(hash_page_current=hash_page_current, **kwargs)
|
|
self.is_page_dog = True
|
|
|
|
"""
|
|
def get_many_dog(self, dog_filters):
|
|
_m = 'Model_View_Dog_Base.get_many_dog'
|
|
av.val_instance(dog_filters, 'dog_filters', _m, Parameters_Dog)
|
|
return DataStore_Dog().get_many_dog(dog_filters)
|
|
"""
|
|
|