Mercurial > hg > Feedworm
annotate backend/sqlalchemy/Preference.py @ 223:f07cf25224a4
do not use python3 - the couchdb lib is not ready for it
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 22 May 2014 05:24:53 +0200 |
parents | 699d8f1cebd4 |
children |
rev | line source |
---|---|
217
bb3c851b18b1
add source file endcoding header
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
119
diff
changeset
|
1 # -*- coding: utf-8 -*- |
43
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 class Preference(object): |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 @staticmethod |
44
be990ac6e478
saving the preference "start maximized" from GUI implemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
43
diff
changeset
|
4 def forKey(key, session): |
be990ac6e478
saving the preference "start maximized" from GUI implemented
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
43
diff
changeset
|
5 return session.query(Preference).filter(Preference.key == key).first() |
218
699d8f1cebd4
unify imports, especially Qt imports. Use consistent super syntax
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
217
diff
changeset
|
6 |
43
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
7 def __init__(self, key, value): |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 self.key = key |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
9 self.value = value |
218
699d8f1cebd4
unify imports, especially Qt imports. Use consistent super syntax
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
217
diff
changeset
|
10 |
43
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
11 def __repr__(self): |
12ed8b5fa08c
first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 return "<Preference %s = %s>" % (self.key, self.value) |