Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
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
Esempio n. 6
0
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
Esempio n. 7
0
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
Esempio n. 8
0
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
Esempio n. 9
0
class StockSchema(ModelSchema):
    """ serializing stock using marshmallow sqlalchemy
    """
    portfolio = fields.Nested(PortfolioSchema, many=True, only='name')

    class meta:
        model = Stock
Esempio n. 10
0
class AccountSchema(ModelSchema):
    """ serializing Account using marshmallow sqlalchemy
    """
    role = fields.Nested(AccountRoleSchema, many=True, only='name')

    class Meta:
        model = Account
Esempio n. 11
0
class AccountSchema(ModelSchema):
    """ Account Schema for the db
    """
    roles = fields.Nested(AccountRoleSchema, many=True, only='name')

    class Meta:
        model = Account
Esempio n. 12
0
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
Esempio n. 13
0
class AccountSchema(ModelSchema):
    roles = fields.Nested(AccountRoleScheme, many=True, only='name')

    class Meta:
        model = Account
Esempio n. 14
0
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
Esempio n. 15
0
class UsersSchema(ModelSchema):
    accounts = fields.Nested(UserAccountsSchema, many=True, exclude=('id', 'date_created', 'date_updated', 'user_id'))

    class Meta:
        model = Users