# HG changeset patch -- Bitbucket.org # Project django-roa # URL http://bitbucket.org/david/django-roa/overview # User David Larlet # Date 1254169637 -7200 # Node ID fe8c29bac8f89d05d6af710bd7c5c8655759e462 # Parent fd83590507065c4d9a12d38e7c74a86a65520a82 Setting id or pk to None in case of a unique get wasn't a good idea --- a/django_roa/db/query.py +++ b/django_roa/db/query.py @@ -224,8 +224,10 @@ class RemoteQuerySet(query.QuerySet): # a staticmethod for get_resource_url_detail and avoid to set it # for all model without relying on get_resource_url_list instance = clone.model() - instance.id = id - instance.pk = pk + if pk is None: + instance.id = id + else: + instance.pk = pk resource = Resource(instance.get_resource_url_detail(), headers=ROA_HEADERS) try: