On Tue, Sep 1, 2009 at 6:01 AM, neridaj<[email protected]> wrote: > > I'm trying to return a QuerySet object from a receiver function, > inside a view, but I'm not quite sure how to do it. I get the error: > my_callback() takes exactly 1 argument (0 given) because I'm > incorrectly calling it without any args, but I'm not sure what to > supply as the sender because as shown in the example I connect to the > receiver with, for instance, request_finished.connect(my_callback). > This works as expected from the output of the the terminal but what if > I want my_callback to return a QuerySet object and I want to access > that from within a view? >
You can't do that. request_finished runs after the request has finished (obviously), which means that the response has been rendered and will be sent to the client immediately / has been sent already, I'm not exactly sure which. It will not work to access the return value of your callback in a view, because the view processing has finished already when the request_finished callbacks are executed. Matthias -- FeinCMS Django CMS building toolkit: http://spinlock.ch/pub/feincms/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en -~----------~----~----~----~------~----~------~--~---
