Hello,

In my architecture, I send messages to a port object (implemented as a
queue in a thread). I'm giving callback function with the result of the
call.

For example, after filling the registration form,

# views.py
...
def createprofile(request):
    ...
    gui_port.send_to(port_profile,('recordprofile',[arg1, arg2,..],
                                        callback,
                                        request))
    return render_to_response('wait.html', locals())

def callback(request, status):
    if status:
        return render_to_response('success.html', locals())
    else:
        return render_to_response('fail.html', locals())


# profilemanager.py (the port object related to profiles)
...
    # when received the message
    try:
        # some operations, update db,...
    except:
        # callback function with status = False
        threading.Thread(target = msg[2], args = (msg[3],False)).start()
    else:
        # callback function with status = False
        threading.Thread(target = msg[2], args = (msg[3],True)).start()


The problem is that (as expected) the callback function doesn't change
the user webpage when it happens.

Is there a way to do it (using AJAX maybe)

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to