mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Make session.default_language set/get work
This commit is contained in:
parent
8cddfefc4c
commit
9fdb8e1bd0
1 changed files with 6 additions and 3 deletions
|
@ -159,12 +159,15 @@ class MultilangSession(Session):
|
|||
|
||||
@property
|
||||
def default_language(self):
|
||||
# XXX need to get the right mapped class for this to work
|
||||
raise NotImplementedError
|
||||
# Need to import tables here to avoid a circular dependency
|
||||
from pokedex.db import tables
|
||||
query = self.query(tables.Language)
|
||||
query = query.filter_by(id=self._default_language_id)
|
||||
return query.one()
|
||||
|
||||
@default_language.setter
|
||||
def default_language(self, new):
|
||||
self._default_language_id = new#.id
|
||||
self._default_language_id = new.id
|
||||
|
||||
@default_language.deleter
|
||||
def default_language(self):
|
||||
|
|
Loading…
Reference in a new issue