Commits

Daniel Ostrowski committed 24c1d68

fix for GenericForeignKey attributes; update hgignore for use with PyCharm;

Comments (0)

Files changed (2)

 *.pyc
 build
 dist
+.idea
+*~
 django_piston.egg-info
 bin
 parts

piston/emitters.py

                 met_fields = self.method_fields(handler, get_fields)
 
                 for f in data._meta.local_fields + data._meta.virtual_fields:
-                    if f.serialize and not any([ p in met_fields for p in [ f.attname, f.name ]]):
+                    if hasattr(f, 'serialize') and f.serialize and not any([ p in met_fields for p in [ f.attname, f.name ]]):
                         if not f.rel:
                             if f.attname in get_fields:
                                 ret[f.attname] = _any(v(f))