David Larlet is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

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: 579.8 KB): HTTPS / SSH
hg clone https://bitbucket.org/david/django-roa
hg clone ssh://hg@bitbucket.org/david/django-roa

Issues

#11 'Response' object has no attribute 'body'

Reported by switchtower

Environment:

Request Method: POST Request URL: http://172.16.190.158/admin/django_roa_client/remotepagewithcustomslug/add/

Django Version: 1.3.1 Python Version: 2.6.5 Installed Applications: ['django_roa', 'django_roa.remoteauth', 'django_roa_client', 'django.contrib.auth', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.sessions'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware')

Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, callback_kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in wrapper 307. return self.admin_site.admin_view(view)(*args, kwargs) File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view 93. response = view_func(request, *args, kwargs) File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func 79. response = view_func(request, *args, kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in inner 197. return view(request, *args, kwargs) File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapper 28. return bound_func(*args, kwargs) File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view 93. response = view_func(request, *args, kwargs) File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in bound_func 24. return func(self, *args2, kwargs2) File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py" in inner 217. res = func(*args, kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in add_view 882. self.save_model(request, new_object, form, change=False) File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in save_model 665. obj.save() File "/root/django-roa/examples/django_roa_client/../django_roa_client/models.py" in save 68. super(RemotePageWithCustomSlug, self).save(force_insert, force_update) File "/usr/local/lib/python2.6/dist-packages/django/db/models/base.py" in save 460. self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "/root/django-roa/django_roa/db/models.py" in save_base 377. response = force_unicode(response.body).encode(settings.DEFAULT_CHARSET)

Exception Type: AttributeError at /admin/django_roa_client/remotepagewithcustomslug/add/ Exception Value: 'Response' object has no attribute 'body'

Status: resolved Responsible: nobody Type: bug Priority: major
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 Anonymous

    written

    It would appear that calling response.body_string() instead of the response.body (db/query.py) fixes this, I wonder if it's a restkit version issue?

  2. #2 Martin Skala

    written

    • Changed status from new to resolved.

    Hi, it should be fixed now. See 8f117f365512 for more details.

  3. #3 cagil

    written

    It is not fixed at Django-1.3-py2.7.egg which I installed via easy_install on Macosx 10.7.3

  4. #4 Martin Skala

    written

    That's correct. The problem is fixed, but the code isn't released yet. Hopefully, it'll change soon.

    By the time you can try to install the git version: pip -e hg+https://bitbucket.org/david/django-roa/#egg=django_roa

  5. #5 Martin Skala

    written

    @cagil: new version of django-roa, that fixes this issue, has been released. You can install it by pip install --upgrade django_roa or easy_install --upgrade django_roa.

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?