Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
python [2016/10/10 16:42] – alte Version wieder hergestellt (2016/03/20 23:42) gevatterpython [2016/10/10 16:42] (current) gevatter
Line 1: Line 1:
 +===== sqlalchemty =====
 +
 +==== access columns and coumns data ====
 +<code>
 +class JobStatus(Base):
 +
 +    ...
 +
 +    def __iter__(self):
 +        values = vars(self)
 +        for attr in self.__mapper__.columns.keys():
 +            if attr in values:
 +                yield attr, values[attr]
 +
 +    def logme(self):
 +        return dict(self)
 +</code>
 +source: http://stackoverflow.com/a/13752442
 +
 ===== json debugging, colored output ===== ===== json debugging, colored output =====
 <code> <code>