f7a30d1616025f5d701de6a267945f4163283330
1 from sqlalchemy
import Column
, ForeignKey
2 from sqlalchemy
.orm
import relation
3 from sqlalchemy
.types
import Integer
, Unicode
5 from spline
.model
.meta
import TableBase
8 __tablename__
= 'users'
9 id = Column(Integer
, primary_key
=True)
10 name
= Column(Unicode(length
=20), nullable
=False)
12 class OpenID(TableBase
):
13 __tablename__
= 'openid'
14 openid
= Column(Unicode(length
=255), primary_key
=True)
15 user_id
= Column(Integer
, ForeignKey('users.id'))
16 user
= relation(User
, lazy
=False, backref
='openids')