Updated login to work correctly with current spline. #69
[zzz-spline-users.git] / spline / plugins / users / model / __init__.py
1 from sqlalchemy import Column, ForeignKey
2 from sqlalchemy.orm import relation
3 from sqlalchemy.types import Integer, Unicode
4
5 from spline.model.meta import TableBase
6
7 class User(TableBase):
8 __tablename__ = 'users'
9 id = Column(Integer, primary_key=True)
10 name = Column(Unicode(length=20), nullable=False)
11
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')
17