Пример #1
0
class Holding(MappedClass, EnhancingClass):
    class __mongometa__:
        session = session
        name = collection_name
        extensions = [HoldingTriggers]

    _id = FieldProperty(schema.ObjectId)
    name = FieldProperty(schema.String(required=True))
    quantity = FieldProperty(schema.Float(required=True))
    price = FieldProperty(schema.Float(required=True))
Пример #2
0
class Service(MappedClass, EnhancingClass):
    class __mongometa__:
        session = session
        name = collection_name

    _id = FieldProperty(schema.ObjectId)
    name = FieldProperty(schema.String(required=True))
    price = FieldProperty(schema.Float(required=True))

    description = FieldProperty(schema.String(if_missing=''))
    avg_duration = FieldProperty(schema.Float(if_missing=None))
Пример #3
0
class PremiumSize(MappedClass, EnhancingClass):
    class __mongometa__:
        session = session
        name = collection_name
        extensions = [PremiumSizeTriggers]

    _id = FieldProperty(schema.ObjectId)
    name = FieldProperty(schema.String(required=True))
    min = FieldProperty(schema.Float(required=True))
    max = FieldProperty(schema.Float(required=True))
    description = FieldProperty(schema.String(if_missing=''))
Пример #4
0
class Salary(MappedClass, EnhancingClass):
    class __mongometa__:
        session = session
        name = collection_name
        custom_indexes = [dict(fields=('worker_id', ), unique=False)]

    _id = FieldProperty(schema.ObjectId)
    worker_id = StringSingleForeignKeyUniqueProperty(Worker, 'worker_id')

    common = FieldProperty(schema.Float(required=True))
    vacation = FieldProperty(schema.Float(required=True))
    sick = FieldProperty(schema.Float(required=True))
Пример #5
0
 def __init__(self, **kw):
     super(MarkdownCache, self).__init__(
         fields=dict(
             md5=S.String(),
             html=S.String(),
             render_time=S.Float()),
         **kw)
Пример #6
0
class Premium(MappedClass, EnhancingClass):
    class __mongometa__:
        session = session
        name = collection_name
        extensions = [PremiumTriggers]
        custom_indexes = [
            dict(fields=('premium_id', ), unique=False),
            dict(fields=('worker_id', ), unique=False)
        ]

    _id = FieldProperty(schema.ObjectId)

    premium_id = StringSingleForeignKeyProperty(PremiumSize)
    worker_id = StringSingleForeignKeyProperty(Worker)
    earning_date = FieldProperty(schema.DateTime(required=True))
    size = FieldProperty(schema.Float(required=True))

    note = FieldProperty(schema.String(if_missing=""))
Пример #7
0
class Request(MappedClass, EnhancingClass):
    class __mongometa__:
        session = session
        name = collection_name
        custom_indexes = [
            dict(fields=('worker_id', ), unique=False),
            dict(fields=('client_id', ), unique=False),
            dict(fields=('service_id', ), unique=False)
        ]

    _id = FieldProperty(schema.ObjectId)

    visit_date_time = VisitDateTimeProperty(Worker, Service)

    worker_ids = StringForeignKeyListProperty(Worker)
    client_ids = StringForeignKeyListProperty(Client)
    service_ids = StringForeignKeyListProperty(Service)
    holdings = HoldingsWithQuantityProperty(Holding)

    note = FieldProperty(schema.String(if_missing=""))
    factical_durability = FieldProperty(schema.Float(if_missing=None))