view 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 source


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)