##// END OF EJS Templates
Model update for sqlalchemy 0.6.0
marcink -
r89:b2c38dee default
parent child Browse files
Show More
@@ -1,27 +1,30
1 from sqlalchemy.ext.declarative import declarative_base
1 import sqlalchemy
2 from pylons_app.model.meta import Base
3 from sqlalchemy import ForeignKey, Column
2 4 from sqlalchemy.orm import relation, backref
3 from sqlalchemy import ForeignKey, Column, Table, Sequence
4 from sqlalchemy.types import *
5 from sqlalchemy.databases.sqlite import *
6 from pylons_app.model.meta import Base
7 5
6 if sqlalchemy.__version__ == '0.6.0':
7 from sqlalchemy.dialects.sqlite import *
8 else:
9 from sqlalchemy.databases.sqlite import SLBoolean as BOOLEAN, \
10 SLInteger as INTEGER, SLText as TEXT, SLDateTime as DATETIME
8 11
9 12 class Users(Base):
10 13 __tablename__ = 'users'
11 14 __table_args__ = {'useexisting':True}
12 user_id = Column("user_id", SLInteger(), nullable=False, unique=True, default=None, primary_key=1)
13 username = Column("username", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
14 password = Column("password", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
15 active = Column("active", SLBoolean(), nullable=True, unique=None, default=None)
16 admin = Column("admin", SLBoolean(), nullable=True, unique=None, default=None)
15 user_id = Column("user_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=1)
16 username = Column("username", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
17 password = Column("password", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
18 active = Column("active", BOOLEAN(), nullable=True, unique=None, default=None)
19 admin = Column("admin", BOOLEAN(), nullable=True, unique=None, default=None)
17 20 action_log = relation('UserLogs')
18 21
19 22 class UserLogs(Base):
20 23 __tablename__ = 'user_logs'
21 24 __table_args__ = {'useexisting':True}
22 id = Column("id", SLInteger(), nullable=False, unique=True, default=None, primary_key=1)
23 user_id = Column("user_id", SLInteger(), ForeignKey(u'users.user_id'), nullable=True, unique=None, default=None)
24 repository = Column("repository", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
25 action = Column("action", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
26 action_date = Column("action_date", SLDateTime(timezone=False), nullable=True, unique=None, default=None)
25 id = Column("id", INTEGER(), nullable=False, unique=True, default=None, primary_key=1)
26 user_id = Column("user_id", INTEGER(), ForeignKey(u'users.user_id'), nullable=True, unique=None, default=None)
27 repository = Column("repository", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
28 action = Column("action", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
29 action_date = Column("action_date", DATETIME(timezone=False), nullable=True, unique=None, default=None)
27 30 user = relation('Users')
General Comments 0
You need to be logged in to leave comments. Login now