pinax / pinax-api

RESTful API adhering to the JSON:API specification
MIT License
14 stars 6 forks source link

builtins.TypeError: can't set attributes of built-in/extension type 'dict' #25

Open grahamu opened 8 years ago

grahamu commented 8 years ago

When using a builtin type for the model, i.e. "dict", the pinax.api.registry.register.as_jsonapi() function fails with:

builtins.TypeError: can't set attributes of built-in/extension type 'dict'

brosner commented 8 years ago

I've spent some time thinking about this. I am beginning to think the as_jsonapi method annotation is a bad idea. It may be okay to leave this functionality for Django models, but the design of resource models allows any object.

I need to look at the code which invoked my implusive feature add and see about fixing it to be more explicit.