comparison rhodecode/model/db.py @ 1716:7d1fc253549e beta

notification to commit author + gardening
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 23 Nov 2011 22:46:14 +0200
parents 54687aa00724
children 7ff304d3028f
comparison
equal deleted inserted replaced
1715:e1e482093077 1716:7d1fc253549e
319 q = cls.query().filter(cls.api_key == api_key) 319 q = cls.query().filter(cls.api_key == api_key)
320 320
321 if cache: 321 if cache:
322 q = q.options(FromCache("sql_cache_short", 322 q = q.options(FromCache("sql_cache_short",
323 "get_api_key_%s" % api_key)) 323 "get_api_key_%s" % api_key))
324 return q.scalar()
325
326 @classmethod
327 def get_by_email(cls, email, cache=False):
328 q = cls.query().filter(cls.email == email)
329
330 if cache:
331 q = q.options(FromCache("sql_cache_short",
332 "get_api_key_%s" % email))
324 return q.scalar() 333 return q.scalar()
325 334
326 def update_lastlogin(self): 335 def update_lastlogin(self):
327 """Update user lastlogin""" 336 """Update user lastlogin"""
328 337