danielholmstrom/dictalchemy — pull request #2 by klinkin (2013-05-14 16:53:54+00:00)
Title: Fix bug with lazy='dynamic'

Attempts to fix issue, in which dynamically loaded SQLAlchemy relationship cause an exception because they are not properly converted to dictionaries.
Example:
class OfferPicture(db.Model):
__tablename__ = 'offer_pictures'

offer_id = db.Column(db.Integer, db.ForeignKey('offers.id'), nullable=False) # id магазина
url = db.Column(db.UnicodeText) # Адрес фото

class Offer(db.Model):
__tablename__ = 'offers'

name = db.Column(db.Unicode(), nullable=False)
pictures = db.relationship('OfferPicture', primaryjoin="OfferPicture.offer_id==Offer.id", backref=db.backref('offer'), lazy='dynamic')