Ejemplo n.º 1
0
 class mapping:
     id = column(Integer, primary_key=True)
     name = column(String(30))
     parent_id = column(Integer,
                        foreign_key=ForeignKey('treenode.id'))
     children = one_to_many('TreeNode',
                            colname='id',
                            backref='parent')
Ejemplo n.º 2
0
 class mapping:
     # note that in other objects, the 'id' primary key is
     # automatically added -- if you specify a primary key,
     # then ActiveMapper will not add an integer primary key
     # for you.
     id = column(Integer, primary_key=True)
     type = column(String)
     address_1 = column(String)
     city = column(String)
     state = column(String)
     postal_code = column(String)
     person_id = column(Integer,
                        foreign_key=ForeignKey('person.id'))
Ejemplo n.º 3
0
 class mapping:
     __table__ = 'preferences'
     favorite_color = column(String)
     personality_type = column(String)
Ejemplo n.º 4
0
 class mapping:
     name = column(String(30))
     foorel = many_to_many("foo", secondarytable, backref='bazrel')
Ejemplo n.º 5
0
 class mapping:
     name = column(String(30))
Ejemplo n.º 6
0
 class mapping:
     __version_id_col__ = 'row_version'
     full_name = column(String)
     first_name = column(String)
     middle_name = column(String)
     last_name = column(String)
     birth_date = column(DateTime)
     ssn = column(String)
     gender = column(String)
     home_phone = column(String)
     cell_phone = column(String)
     work_phone = column(String)
     row_version = column(Integer, default=0)
     prefs_id = column(Integer,
                       foreign_key=ForeignKey('preferences.id'))
     addresses = one_to_many(
         'Address',
         colname='person_id',
         backref='person',
         order_by=['state', 'city', 'postal_code'])
     preferences = one_to_one('Preferences',
                              colname='pref_id',
                              backref='person')
Ejemplo n.º 7
0
 class mapping:
     id = column(Integer, primary_key=True)
     address = column(String(40))
     city = column(String(40))
     person_id = column(Integer,
                        foreign_key=ForeignKey("person.id"))
Ejemplo n.º 8
0
 class mapping:
     id = column(Integer, primary_key=True)
     name = column(String(40))
     addresses = one_to_many("Address")
Ejemplo n.º 9
0
 class mapping:
     main_id = column(Integer)
     test_id = column(
         Integer,
         foreign_key=ForeignKey('testactivemapper.main_id'))