File: person.py

package info (click to toggle)
sqlobject 3.12.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,684 kB
  • sloc: python: 17,536; makefile: 162; sh: 95
file content (26 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from SQLObject import *
conn = PostgresConnection(db = 'merchant_test', user = 'merchant_test', password = 'mtest')

class Role(SQLObject):
    _connection = conn

    name = StringCol(length = 20)
    people = RelatedJoin('Person')
    
class Person(SQLObject):
    _cacheValues = False

    _connection = conn
    
    firstName = StringCol(length = 100)
    middleInitial = StringCol(length = 1)
    lastName = StringCol(length = 150)
    phoneNumbers = MultipleJoin("PhoneNumber") 

    roles = RelatedJoin('Role')

class PhoneNumber(SQLObject):
    _connection = conn

    person = ForeignKey('Person')
    phoneNumber = StringCol(length = 10)