Example #1
0
 class B(self.Entity):
     has_field('name', String(100), primary_key=True)
Example #2
0
        class A(self.Entity):
            has_field('name', String(100))

            has_and_belongs_to_many('bs', of_kind='B')
Example #3
0
 class Person(self.Entity):
     has_field('firstname', String(30))
     has_field('surname', String(30))
Example #4
0
 class Tag(self.Entity):
     has_field('score1', Float)
     has_field('score2', Float)
     has_property(
         'score', lambda c: column_property(
             (c.score1 * c.score2).label('score')))
Example #5
0
 class Animal( self.Entity ):
     has_field('name', String(30))
     belongs_to('owner', of_kind='Person')
Example #6
0
 class Person( self.Entity ):
     has_field('name', String(30))
     has_many('pets', of_kind='Animal')