Использование Parse.com для загрузки UIWebView из выбора ячеек UITableView

Решение, которое также работает с наследуемыми классами:

from itertools import chain
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()


class Mixin(object):
    def as_dict(self):
        tables = [base.__table__ for base in self.__class__.__bases__ if base not in [Base, Mixin]]
        tables.append(self.__table__)
        return {c.name: getattr(self, c.name) for c in chain.from_iterable([x.columns for x in tables])}
0
задан Jen Tye 26 February 2015 в 22:13
поделиться