4 ms·
To both the django-rest-framework advocates: thanks for the recommendation, will check it out. I got deep in the guts of tastypie and wasn't happy with the way
by jspiral 14y ago
To both the django-rest-framework advocates:
thanks for the recommendation, will check it out. I got deep in the guts of tastypie and wasn't happy with the way it handles patching and nested objects in particular.
For my kiosk project, as an example, I need to send a nested object graph over the wire. The wifi card in the kiosks isn't very reliable, so doing it in one call is very helpful (only one thing to retry a couple times, vs 10-ish objects, max depth of 4).
From what I can tell, django-rest-framework is read-only beyond one level of depth (you can return a nested hierarchy, but not post it in one shot)
Also, some of my objects are transient (e.g. credit card data), so I don't have a django model for each object that is an input to the api. (I have a plain old python class with some special magic for parsing track data, validation fields, etc for credit card and drivers license in particular, can't ever save that data to the db).
would you use django-rest-framework for that?
(also, is there a django equivalent of ActiveAttr, which lets you make ruby classes that act like active record objects without the persistence? or would you just make models and never save them? probably wouldn't look so good in an audit though)
- iends 14y agoI actually just had a conversation at work about this (although unrelated to Django). Almost all REST frameworks I've encountered have no support for POSTing of nested objects. I do not know of an ActiveAttr equivalent.