from ma import ma
from models.johnson_scanner_data import JohnsonScannerDataModel
from schemas.brand import BrandSchema
from schemas.category import CategorySchema
from schemas.facts_in_data import FactsInDataSchema
from schemas.market import MarketSchema
from schemas.period import PeriodSchema


class JohnsonScannerDataSchema(ma.SQLAlchemySchema):
    market = ma.Nested(MarketSchema)
    brand = ma.Nested(BrandSchema)
    category = ma.Nested(CategorySchema)
    period = ma.Nested(PeriodSchema)
    facts = ma.Nested(FactsInDataSchema, many=True)

    class Meta:
        model = JohnsonScannerDataModel
        dump_only = ("id",)
        # include_fk = False




[((11, 13, 11, 36), 'ma.ma.Nested', 'ma.Nested', ({(11, 23, 11, 35): 'MarketSchema'}, {}), '(MarketSchema)', False, 'from ma import ma\n'), ((12, 12, 12, 34), 'ma.ma.Nested', 'ma.Nested', ({(12, 22, 12, 33): 'BrandSchema'}, {}), '(BrandSchema)', False, 'from ma import ma\n'), ((13, 15, 13, 40), 'ma.ma.Nested', 'ma.Nested', ({(13, 25, 13, 39): 'CategorySchema'}, {}), '(CategorySchema)', False, 'from ma import ma\n'), ((14, 13, 14, 36), 'ma.ma.Nested', 'ma.Nested', ({(14, 23, 14, 35): 'PeriodSchema'}, {}), '(PeriodSchema)', False, 'from ma import ma\n'), ((15, 12, 15, 51), 'ma.ma.Nested', 'ma.Nested', (), '', False, 'from ma import ma\n')]