コード例 #1
0
ファイル: holdings.py プロジェクト: zeionara/barbershop
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
ファイル: premium_sizes.py プロジェクト: zeionara/barbershop
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
ファイル: salaries.py プロジェクト: ostaninanastya/barbershop
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
ファイル: requests.py プロジェクト: zeionara/barbershop
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))