Skip to content

Instantly share code, notes, and snippets.

@jpadilla
Created December 1, 2011 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpadilla/ea1afa28caf4859b2f26 to your computer and use it in GitHub Desktop.
Save jpadilla/ea1afa28caf4859b2f26 to your computer and use it in GitHub Desktop.
Environment:
Request Method: PUT
Request URL: http://localhost:8000/api/booking/1/?format=json
Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'south',
'django_fields',
'tastypie',
'debug_toolbar',
'core']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware')
Traceback:
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
39. resp = view_func(*args, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
52. return view_func(*args, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in wrapper
192. response = callback(request, *args, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in dispatch_detail
406. return self.dispatch('detail', request, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in dispatch
427. response = method(request, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in put_detail
1131. updated_bundle = self.obj_update(bundle, request=request, **self.remove_api_resource_names(kwargs))
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in obj_update
1818. bundle = self.full_hydrate(bundle)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in full_hydrate
698. value = field_object.hydrate(bundle)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/fields.py" in hydrate
641. return self.build_related_resource(value, request=bundle.request)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/fields.py" in build_related_resource
593. return self.resource_from_data(self.fk_resource, value, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/fields.py" in resource_from_data
548. return fk_resource.obj_update(fk_bundle, **data)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in obj_update
1814. bundle.obj = self.obj_get(request, **lookup_kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/tastypie/resources.py" in obj_get
1752. base_object_list = self.get_object_list(request).filter(**kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/query.py" in filter
550. return self._filter_or_exclude(False, *args, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/query.py" in _filter_or_exclude
568. clone.query.add_q(Q(*args, **kwargs))
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/sql/query.py" in add_q
1194. can_reuse=used_aliases, force_having=force_having)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/sql/query.py" in add_filter
1129. connector)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/sql/where.py" in add
67. value = obj.prepare(lookup_type, value)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/sql/where.py" in prepare
316. return self.field.get_prep_lookup(lookup_type, value)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/fields/related.py" in get_prep_lookup
136. return self._pk_trace(value, 'get_prep_lookup', lookup_type)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/fields/related.py" in _pk_trace
209. v = getattr(field, prep_func)(lookup_type, v, **kwargs)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/fields/__init__.py" in get_prep_lookup
292. return self.get_prep_value(value)
File "/Users/jpadilla/.virtualenvs/SolutionsCay/lib/python2.7/site-packages/django/db/models/fields/__init__.py" in get_prep_value
479. return int(value)
Exception Type: TypeError at /api/booking/1/
Exception Value: int() argument must be a string or a number, not 'ManyRelatedManager'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment