class StockSchema(ModelSchema): roles = fields.Nested(AccountRoleSchema, many=True, only='name') account = fields.Nested(AccountSchema, exclude=('password', 'locations', 'roles', 'date_created', 'date_updated')) class Meta: model = Stock
class NltkResultsSchema(ModelSchema): """ Schema for the db """ roles = fields.Nested(AccountRoleSchema, many=True, only='name') account = fields.Nested(AccountSchema, exclude=( 'password', 'nltk_result', 'roles', 'date_created', 'date_updated')) class Meta: model = NLTKOutput
class PortfolioSchema(ModelSchema): # This is really just an example of multiple fields being defined on this schema roles = fields.Nested(AccountRoleSchema, many=True, only='name') account = fields.Nested(AccountSchema, exclude=('password', 'locations', 'roles', 'date_created', 'date_updated')) class Meta: model = Portfolio
class PortfolioSchema(ModelSchema): """ serializing Portforlio using marshmallow sqlalchemy """ roles = fields.Nested(AccountRoleSchema, many=True, only='name') account = fields.Nested(AccountSchema, exclude=('password', 'locations', 'roles', 'data_created', 'date_updated')) class meta: model = Portfolio
class PortfolioSchema(ModelSchema): """this schema model is based on the portfolio. this will build upon the two above schemas, the roles and accounts. the account section will not include the password, locations, roles and dates for security reasons. """ roles = fields.Nested(AccountRoleSchema, many=True, only='name') account = fields.Nested(AccountSchema, exclude=( 'password', 'locations', 'roles', 'date_created', 'date_updated', )) class Meta: model = Portfolio
class StockSchema(ModelSchema): """this schema model is based on the stock. this will also build on the account and role schemas. similarly true as the portfolio schema, the account section will not include the password, locations, roles, and dates for security reasons """ roles = fields.Nested(AccountRoleSchema, many=True, only='name') account = fields.Nested(AccountSchema, exclude=( 'password', 'locations', 'roles', 'date_created', 'date_updated', )) class Meta: model = Stock
class PortfolioSchema(ModelSchema): roles = fields.Nested(AccountRoleSchema, many=True, only='name') account = fields.Nested(AccountSchema, exclude=( 'password', 'portfolios', 'roles', 'date_created', 'date_updated', )) class Meta: model = Portfolio
class AccountSchema(ModelSchema): # all marshmallow - go get the records that belong to the id # This is really just an example of multiple fields roles = fields.Nested(AccountRoleSchema, many=True, only='name') class Meta: model = Account
class StockSchema(ModelSchema): """ serializing stock using marshmallow sqlalchemy """ portfolio = fields.Nested(PortfolioSchema, many=True, only='name') class meta: model = Stock
class AccountSchema(ModelSchema): """ serializing Account using marshmallow sqlalchemy """ role = fields.Nested(AccountRoleSchema, many=True, only='name') class Meta: model = Account
class AccountSchema(ModelSchema): """ Account Schema for the db """ roles = fields.Nested(AccountRoleSchema, many=True, only='name') class Meta: model = Account
class AccountSchema(ModelSchema): """this schema model is based on the account. The meta class references the meta model and will be filled with the Account model. the roles field will also use the role schema from above and use the name """ roles = fields.Nested(AccountRoleSchema, many=True, only='name') class Meta: model = Account
class AccountSchema(ModelSchema): roles = fields.Nested(AccountRoleScheme, many=True, only='name') class Meta: model = Account
class AccountSchema(ModelSchema): # exclusively ask for one or my columns from a record. Excludes password roles = fields.Nested(AccountRoleSchema, many=True, only='name') class Meta: model = Account
class UsersSchema(ModelSchema): accounts = fields.Nested(UserAccountsSchema, many=True, exclude=('id', 'date_created', 'date_updated', 'user_id')) class Meta: model = Users