Closed yedpodtrzitko closed 11 years ago
there are two ajax requests in firebug:
> OPTIONS /admin-api/draft/39/ < 200 OK < GET,POST,PUT,DELETE,PATCH
and second:
> PATCH /admin-api/draft/39/ < 500 INTERNAL SERVER ERROR localhost:8000 3.6 KB 127.0.0.1:8000 86ms HeadersResponseJSONCookies {"error_message": "Cannot resolve keyword 'read_only_fields' into field. Choices are: api_key, author, date_joined, draft, email, first_name, groups, id, is_active, is_staff, is_superuser, last_login, last_name, logentry, password, principalrolerelation, profile, publishablelock, ratingevent, user_permissions, usergalleryitem, username", "traceback": "Traceback (most recent call last):\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 202, in wrapper\n response = callback(request, *args, **kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 450, in dispatch_detail\n return self.dispatch('detail', request, **kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 474, in dispatch\n response = method(request, **kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1437, in patch_detail\n self.update_in_place(request, bundle, deserialized)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1460, in update_in_place\n return self.obj_update(original_bundle, **kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1999, in obj_update\n bundle = self.full_hydrate(bundle)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 780, in full_hydrate\n value = field_object.hydrate(bundle)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/fields.py\", line 661, in hydrate\n return self.build_related_resource(value, request=bundle.request)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/fields.py\", line 603, in build_related_resource\n return self.resource_from_data(self.fk_resource, value, **kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/fields.py\", line 554, in resource_from_data\n return fk_resource.obj_update(fk_bundle, skip_errors=True, **data)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1995, in obj_update\n bundle.obj = self.obj_get(bundle.request, **lookup_kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/src/django-tastypie/tastypie/resources.py\", line 1903, in obj_get\n base_object_list = self.get_object_list(request).filter(**kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/lib/python2.7/site-packages/django/db/models/query.py\", line 624, in filter\n return self._filter_or_exclude(False, *args, **kwargs)\n\n File \"/home/yed/skript/sanoma/daz2/venv/lib/python2.7/site-packages/django/db/models/query.py\", line 642, in _filter_or_exclude\n clone.query.add_q(Q(*args, **kwargs))\n\n File \"/home/yed/skript/sanoma/daz2/venv/lib/python2.7/site-packages/django/db/models/sql/query.py\", line 1250, in add_q\n can_reuse=used_aliases, force_having=force_having)\n\n File \"/home/yed/skript/sanoma/daz2/venv/lib/python2.7/site-packages/django/db/models/sql/query.py\", line 1122, in add_filter\n process_extras=process_extras)\n\n File \"/home/yed/skript/sanoma/daz2/venv/lib/python2.7/site-packages/django/db/models/sql/query.py\", line 1316, in setup_joins\n \"Choices are: %s\" % (name, \", \".join(names)))\n\nFieldError: Cannot resolve keyword 'read_only_fields' into field. Choices are: api_key, author, date_joined, draft, email, first_name, groups, id, is_active, is_staff, is_superuser, last_login, last_name, logentry, password, principalrolerelation, profile, publishablelock, ratingevent, user_permissions, usergalleryitem, username\n"}
note: draft with pk 39 exists (if 39 in request means draft's pk)
39
there are two ajax requests in firebug:
and second: