view Preference.py @ 62:abc0516a1c0c

FeedEntry provides a static method for creating new entries: better modularization and support for working with the class in interactive mode. FeedUpdater's normalize method is a module function now, again for ease of use in interactive scenarios
author dirk@xanthippe.ping.de
date Wed, 28 Jul 2010 20:30:34 +0200
parents be990ac6e478
children
line wrap: on
line source


class Preference(object):
    @staticmethod
    def forKey(key, session):
        return session.query(Preference).filter(Preference.key == key).first()
    
    def __init__(self, key, value):
        self.key = key
        self.value = value
    
    def __repr__(self):
        return "<Preference %s = %s>" % (self.key, self.value)