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.
| commit 128: | fe8c29bac8f8 |
| parent 127: | fd8359050706 |
| branch: | default |
Setting id or pk to None in case of a unique get wasn't a good idea
11 months ago
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: |
