Reusing lower level bits of django-rest-interface

2 views
Skip to first unread message

Erik Allik

unread,
Jun 5, 2009, 10:28:27 AM6/5/09
to Django REST interface
Hey!

I'm writing a RESTful API front end for a rather complex database/back
end and mapping database tables/Django models to RESTful resources 1:1
would be negative. I still need a RESTful way to do HTTP input
validation and returning of correct HTTP status codes and response
bodies.

I was wondering if django-rest-interface provided lower level tools to
do the job instead of just classes to map tables to resources. Or
classes with a bunch of empty stub methods to do the plumbing, waiting
for the programmer to implement communication with the database/models
and actual domain specific algorithms and validations?

Regards,
Erik Allik

S.Lott

unread,
Jun 8, 2009, 7:33:01 AM6/8/09
to Django REST interface
That's how we started. Eventually, we wound up ditching Django-REST-
API entirely.

If you're not using their collections, then all that's left is
authentication.

Consider designing a class which authenticates the HTTP_AUTHORIZATION
header, checks the user's permissions and then dispatches GET, POST,
PUT and DELETE to separate methods of the class.

A subclass can then do the real work of the URI, either fetching from
a query set, using a Form to validate and persist objects.
Reply all
Reply to author
Forward
0 new messages