11

We would like to have a OData JSON interface on our Django (Python 2.5.4) website. At the moment of writing there seems to be no library available.

I'm thinking of writing "some" logic to handle this ourselves.

  • Would it be a good idea to extend the Django JSON serializer?
  • Where and how to store the URI's related to the models?
Community
  • 1
  • 1
Mark
  • 578
  • 8
  • 13
  • We did decide it was not worth the time & money to implement it at the time. I'm no longer working on the project so unfortunately I can't help you with this. If you do find/have a way to implement this be sure to put it here, I'll be happy to accept your solution. – Mark Jul 30 '12 at 09:09

1 Answers1

1

I think it would be a good idea to extend the Django JSON serializer, but have a look at django-piston this might be the better route to go.

The URI's will have to be defined in your urls.py for your app, and then in your models you could define a function

get_odata_uri()

Which would work like the Django's get_absolute_url(). Instead of hardcoding it into your model, make sure you make use of the reverse function from django.core.urlresolvers

Neskie
  • 66
  • 2