projects
/
zzz-pokedex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f2d7079
)
Make session.default_language set/get work
author
Petr Viktorin
<encukou@gmail.com>
Sun, 3 Apr 2011 19:05:56 +0000
(22:05 +0300)
committer
Petr Viktorin
<encukou@gmail.com>
Mon, 4 Apr 2011 01:18:37 +0000
(
04:18
+0300)
pokedex/db/multilang.py
patch
|
blob
|
history
diff --git
a/pokedex/db/multilang.py
b/pokedex/db/multilang.py
index
4adb68d
..
b5f87e4
100644
(file)
--- a/
pokedex/db/multilang.py
+++ b/
pokedex/db/multilang.py
@@
-159,12
+159,15
@@
class MultilangSession(Session):
@property
def default_language(self):
@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):
@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):
@default_language.deleter
def default_language(self):