diff Preference.py @ 43:12ed8b5fa08c

first system preference: configure app to stat maximized.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 14 May 2010 08:31:46 +0200
parents
children be990ac6e478
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Preference.py	Fri May 14 08:31:46 2010 +0200
@@ -0,0 +1,16 @@
+
+class Preference(object):
+    @staticmethod
+    def valueForKey(key, session):
+        pref = session.query(Preference).filter(Preference.key == key).first()
+        if pref is not None:
+            return pref.value
+        else:
+            return None
+    
+    def __init__(self, key, value):
+        self.key = key
+        self.value = value
+    
+    def __repr__(self):
+        return "<Preference %s = %s>" % (self.key, self.value)