Changeset - b0ed41df0282
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-06-07 03:37:07
mads@kiilerich.com
db: drop __mapper_args__ that cause SQLAlchemy deprecation warnings

We don't really need them. There were only few uses left, and we seem to be
using .order_by() in all places where we really care about the ordering.

Gets rid of

<string>:2
<string>:2: SADeprecationWarning: Mapper.order_by is deprecated.Use Query.order_by() in order to affect the ordering of ORM result sets.
1 file changed with 0 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/model/db.py
Show inline comments
 
@@ -706,7 +706,6 @@ class UserApiKeys(Base, BaseDbModel):
 
        Index('uak_api_key_expires_idx', 'api_key', 'expires'),
 
        _table_args_default_dict,
 
    )
 
    __mapper_args__ = {}
 

	
 
    user_api_key_id = Column(Integer(), primary_key=True)
 
    user_id = Column(Integer(), ForeignKey('users.user_id'), nullable=False)
 
@@ -728,7 +727,6 @@ class UserEmailMap(Base, BaseDbModel):
 
        Index('uem_email_idx', 'email'),
 
        _table_args_default_dict,
 
    )
 
    __mapper_args__ = {}
 

	
 
    email_id = Column(Integer(), primary_key=True)
 
    user_id = Column(Integer(), ForeignKey('users.user_id'), nullable=False)
 
@@ -758,7 +756,6 @@ class UserIpMap(Base, BaseDbModel):
 
        UniqueConstraint('user_id', 'ip_addr'),
 
        _table_args_default_dict,
 
    )
 
    __mapper_args__ = {}
 

	
 
    ip_id = Column(Integer(), primary_key=True)
 
    user_id = Column(Integer(), ForeignKey('users.user_id'), nullable=False)
 
@@ -1470,7 +1467,6 @@ class RepoGroup(Base, BaseDbModel):
 
    __table_args__ = (
 
        _table_args_default_dict,
 
    )
 
    __mapper_args__ = {'order_by': 'group_name'} # TODO: Deprecated as of SQLAlchemy 1.1.
 

	
 
    SEP = ' &raquo; '
 

	
0 comments (0 inline, 0 general)