Пример #1
0
 class C(Base):
     if is_value_default:
         code = Text(default_value='alabala')
     else:
         code = Text()
     if is_reference:
         ime = Reference(Name, auto_set=is_auto_set, lazy=is_lazy)
     else:
         ime = Text()  #TODO must make a deferred_column when is_lazy
Пример #2
0
    class Employee(Base):
        auto_set = False  #StaticTypeing; else: maximum recursion depth at cascade_*
        DBCOOK_inheritance = inh
        DBCOOK_has_instances = True

        name = Text()
        dept = Reference('Dept')
Пример #3
0
class Employee( Base):
    name    = Text()
    age     = Int()
    dept    = o2r.Reference( 'Dept')
    lover   = o2r.Reference( 'Employee')
    manager = o2r.Reference( 'Employee')    #or 'Manager'
    DBCOOK_inheritance = inh        #for subclasses - this one is always concrete anyway
    DBCOOK_has_instances = True     #by default only class-tree leaves have instances
Пример #4
0
 class Name(Base):
     nime = Text()
Пример #5
0
 class Dept(Base):
     boss = Reference(Manager)
     name = Text()
Пример #6
0
 class Hacker(Engineer):
     tools = Text()
Пример #7
0
class Dept( Base):
    manager = o2r.Reference( Manager)
    name = Text()
    director = o2r.Reference( 'Director')
Пример #8
0
class Engineer( Employee):
    machine = Text()
Пример #9
0
class Manager( Employee):
    secretary = o2r.Reference( Employee)
    extras = Text()
    DBCOOK_has_instances = True