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




[((364, 387), 'ma.ma.Nested', 'ma.Nested', (['MarketSchema'], {}), '(MarketSchema)\n', (373, 387), False, 'from ma import ma\n'), ((400, 422), 'ma.ma.Nested', 'ma.Nested', (['BrandSchema'], {}), '(BrandSchema)\n', (409, 422), False, 'from ma import ma\n'), ((438, 463), 'ma.ma.Nested', 'ma.Nested', (['CategorySchema'], {}), '(CategorySchema)\n', (447, 463), False, 'from ma import ma\n'), ((477, 500), 'ma.ma.Nested', 'ma.Nested', (['PeriodSchema'], {}), '(PeriodSchema)\n', (486, 500), False, 'from ma import ma\n'), ((513, 552), 'ma.ma.Nested', 'ma.Nested', (['FactsInDataSchema'], {'many': '(True)'}), '(FactsInDataSchema, many=True)\n', (522, 552), False, 'from ma import ma\n')]