Mercurial > hg > Feedworm
comparison backend/sqlalchemy/Preference.py @ 119:04a730f9d07d backend
move all sqlalchemy related classes to the respective sub-package. use a backend to abstract from access to the data
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sun, 21 Aug 2011 03:55:16 +0200 |
parents | Preference.py@be990ac6e478 |
children | bb3c851b18b1 |
comparison
equal
deleted
inserted
replaced
118:0e73adb2dec4 | 119:04a730f9d07d |
---|---|
1 | |
2 class Preference(object): | |
3 @staticmethod | |
4 def forKey(key, session): | |
5 return session.query(Preference).filter(Preference.key == key).first() | |
6 | |
7 def __init__(self, key, value): | |
8 self.key = key | |
9 self.value = value | |
10 | |
11 def __repr__(self): | |
12 return "<Preference %s = %s>" % (self.key, self.value) |