Re: Multiple AJAX sends within a views.py-function

2010-06-16 Thread Christoph Siedentop
Hi Ian, On Wed, Jun 16, 2010 at 4:11 PM, Ian McDowall wrote: > Cool. That is a clever way to subvert (I don't mean this negatively) > the response generation.  I do have a couple of comments: :-) Thanks > 1) It relies on the response being sent to the client as it is > generated and not buffered

Re: Multiple AJAX sends within a views.py-function

2010-06-16 Thread Ian McDowall
Cool. That is a clever way to subvert (I don't mean this negatively) the response generation. I do have a couple of comments: 1) It relies on the response being sent to the client as it is generated and not buffered by the server. That is clearly working for you and I don't know the internals of

Re: Multiple AJAX sends within a views.py-function

2010-06-15 Thread Christoph Siedentop
Hi Dmitry, hi Ian, thanks for the help. I got it to work. Here is what I am doing. Django gets a request for "/data.json". A view function is called. This is my function: def data(request): return HttpResponse(subsampling(), mimetype='application/javascript') subsampling() is an iterator

Re: Multiple AJAX sends within a views.py-function

2010-06-14 Thread Ian McDowall
As the other posters say, this is not possible with standard HTTP and certainly not with Django. By default, HTTP is one request / one response and Django (and other web frameworks) are built on that. Take a look at the HTTP spec and try looking at the packet contents for HTTP requests - it is qu

Re: Multiple AJAX sends within a views.py-function

2010-06-11 Thread Dmitry Dulepov
Hi! Christoph wrote: > normally in views.py I have a function that takes a request and > returns a render_to_response or the like. I, however, would like it to > take a request and have Django reply with multiple responses. Is there > a way to do this, or is this not possible with HTTP anyway? HT

Re: Multiple AJAX sends within a views.py-function

2010-06-11 Thread Rafael Nunes
Can't you use XMPP? On Fri, Jun 11, 2010 at 12:36 PM, Euan Goddard wrote: > If you're worried about the data getting out of order use a counter in > JS and always ensure that you only update the page when you get the > correct (i.e. current) counter back. > > I think what you're talking about isn

Re: Multiple AJAX sends within a views.py-function

2010-06-11 Thread Euan Goddard
If you're worried about the data getting out of order use a counter in JS and always ensure that you only update the page when you get the correct (i.e. current) counter back. I think what you're talking about isn't possible in normal HTTP. I think you have a one request, one response situation.

Multiple AJAX sends within a views.py-function

2010-06-11 Thread Christoph
Hi, normally in views.py I have a function that takes a request and returns a render_to_response or the like. I, however, would like it to take a request and have Django reply with multiple responses. Is there a way to do this, or is this not possible with HTTP anyway? What I am trying to achieve