##// END OF EJS Templates
fixed Session problems in model class functions...
marcink -
r1081:70bf0be5 beta
parent child Browse files
Show More
@@ -31,12 +31,21 b' from datetime import date'
31 31 from sqlalchemy import *
32 32 from sqlalchemy.exc import DatabaseError
33 33 from sqlalchemy.orm import relationship, backref
34 from sqlalchemy.orm.session import Session
34 from sqlalchemy.orm.interfaces import MapperExtension
35 35
36 from rhodecode.model.meta import Base
36 from rhodecode.model.meta import Base, Session
37 37
38 38 log = logging.getLogger(__name__)
39 39
40 #==============================================================================
41 # MAPPER EXTENSIONS
42 #==============================================================================
43
44 class RepositoryMapper(MapperExtension):
45 def after_update(self, mapper, connection, instance):
46 pass
47
48
40 49 class RhodeCodeSettings(Base):
41 50 __tablename__ = 'rhodecode_settings'
42 51 __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True})
@@ -161,6 +170,8 b' class UsersGroupMember(Base):'
161 170 class Repository(Base):
162 171 __tablename__ = 'repositories'
163 172 __table_args__ = (UniqueConstraint('repo_name'), {'useexisting':True},)
173 __mapper_args__ = {'extension':RepositoryMapper()}
174
164 175 repo_id = Column("repo_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
165 176 repo_name = Column("repo_name", String(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=True, default=None)
166 177 repo_type = Column("repo_type", String(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=False, default='hg')
General Comments 0
You need to be logged in to leave comments. Login now