david / django-roa (http://welldev.org/)

Turn your models into remote resources that you can access through Django's ORM. ROA stands for Resource Oriented Architecture.

Clone this repository (size: 560.7 KB): HTTPS / SSH
$ hg clone http://code.welldev.org/django-roa

Changed (Δ45 bytes):

raw changeset »

django_roa/db/query.py (4 lines added, 2 lines removed)

Up to file-list django_roa/db/query.py:

@@ -224,8 +224,10 @@ class RemoteQuerySet(query.QuerySet):
224
224
        # a staticmethod for get_resource_url_detail and avoid to set it
225
225
        # for all model without relying on get_resource_url_list
226
226
        instance = clone.model()
227
        instance.id = id
228
        instance.pk = pk
227
        if pk is None:
228
            instance.id = id
229
        else:
230
            instance.pk = pk
229
231
        resource = Resource(instance.get_resource_url_detail(), headers=ROA_HEADERS)
230
232
        
231
233
        try: