view backend/sqlalchemy/Preference.py @ 229:f0b5bdce1189

fix the preferences dialog after update to the new style api
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 02 Jul 2014 18:20:56 +0200 (2014-07-02)
parents 699d8f1cebd4
children
line wrap: on
line source
# -*- coding: utf-8 -*-
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)