"""TV channel objects: only really need an ID and a label """ from sqlobject import SQLObject, StringCol, MultipleJoin class Channel(SQLObject): label = StringCol(default="") tuners = MultipleJoin("ChannelTuner") def get_data(self): d = {} for key in ("label", "id"): d[key] = getattr(self, key) return d