2๐
I just had the same problem, but found the correct answer over here:
http://groups.google.com/group/django-tastypie/tree/browse_frm/thread/801f44af3f2dbe7b/a36f303380eacf96
it seems django-tasty-pie version 0.9.9 didnโt have this attribute but version 0.9.10 does!
so if you use buildout, look in to buildout.cfg
under versions:
search for django-tastypie = 0.9.9
remove this one and see what your install picks or replace it with:
django-tastypie = 0.9.10
I still have this problem, so opened a new link, see:
django-tastypie: Cannot access bundle.request in dehydrate(self,bundle)
in the question above I found out, that using 0.9.10 is not enough, version 1.0.0 beta should do the tric..
3๐
Bundle object has request attribute.
class Bundle(object):
"""
A small container for instances and converted data for the
``dehydrate/hydrate`` cycle.
Necessary because the ``dehydrate/hydrate`` cycle needs to access data at
different points.
"""
def __init__(self, obj=None, data=None, request=None):
self.obj = obj
self.data = data or {}
self.request = request or HttpRequest()
Anyway, you can ovveride the Resource method higher than dehydrate
in the call stack.
Could you show the code?
- [Django]-Understanding / mySQL aka tricking ForeignKey relationships in Django
- [Django]-Django.db.utils.NotSupportedError: FOR UPDATE cannot be applied to the nullable side of an outer join
- [Django]-How can I create custom form for User model Django
- [Django]-TypeError Django