jfinkels/flask-restless — pull request #147 by glyphobet (2013-02-07 15:46:03+00:00)
Title: AssociationProxy fields don't have a property value

If you are using `sqlalchemy.ext.associationproxy.association_proxy` for any of your columns, then flask-restless will crash when trying to save. It is checking the properties on fields in the model to find out of they are date/datetime fields, but `AssociationProxy` fields don't have `property` attributes, so that code just crashes:

File "flask_restless/views.py", line 1381, in put
return self.patch(instid)
File "flask_restless/views.py", line 1346, in patch
data = self._strings_to_dates(data)
File "flask_restless/views.py", line 880, in _strings_to_dates
if _is_date_field(self.model, fieldname) and value is not None:
File "flask_restless/views.py", line 119, in _is_date_field
prop = getattr(model, fieldname).property

This patch changes it to pass through to the real field on the remote table when an `AssociationProxy` is encountered, so that field can be checked for whether or not this is a date value.