Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Update user page after thread execution [RSS Feed]

#1 Dec. 15, 2010 11:26:31

m.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Update user page after thread execution


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',,
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, args = (msg,False)).start()
else:
# callback function with status = False
threading.Thread(target = msg, args = (msg,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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Update user page after thread execution [RSS Feed]

Board footer

Moderator control

Enjoy the 11th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support