Re: Django + ajax waiting page, can not redirect to result page

2011-12-16 Thread yun li
iewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) ROOT_URLCONF = 'mytest.urls' TEMPLATE_DIRS = ( 'C:/Users/yun/tmp/mytest/templates' # Put strings here, like "/home/html/django_templates&qu

Re: Django + ajax waiting page, can not redirect to result page

2011-12-16 Thread yun li
gt; On Fri, Dec 16, 2011 at 5:24 AM, yun li <yli0...@gmail.com> wrote: > >> Since I am really know nothing about ajax, I am not sure if I >> understand "try changing the return value from the view to a string " >> the right way. I changed the definition of run

Re: Django + ajax waiting page, can not redirect to result page

2011-12-15 Thread yun li
quot;: true} > > And then change this line in the JavaScript: > > if (data == 'OK') { > > to: > > if (data.ok) { > > I think it should work with those changes. If it doesn't, try checking the > JavaScript console in your browser for any errors. > > Brett > > O

Re: Django + ajax waiting page, can not redirect to result page

2011-12-14 Thread yun li
if (data == 'OK') { > window.location.href = '{% url displayDHM %}'; > } else { > alert(data); > } > }); > }); > > > > Please wait. > > > > I've also added a bit more to the HTML fi

Re: Django + ajax waiting page, can not redirect to result page

2011-12-14 Thread yun li
Hi, Does anyone can help? Here are all contents in my files, I tried variable ways, but when I submit a form, it only return the please_wait page and then stay there forever. There is no redirect happened. Since I want to check if it works first, there is no actual calculation in the code.

Django + ajax waiting page, can not redirect to result page

2011-12-14 Thread yun li
Hi all, I have the problem for constructing waiting page using Django + ajax. I followed instructions mentioned in the following link, http://groups.google.com/group/django-users/browse_thread/thread/c1b0d916bbf86868. However, when I run my program, it stops in http://127.0.0.1:8000/please_wait

There has a login user problem

2009-10-12 Thread zhichao Yun
Model: class X(models.Model): user = models.ForeignKey(User, blank=True, null=True) x= other() # I want to add current user when add X Form: class xForm(forms.ModelForm): class Meta: model = X exclude = ('marker') View: def add_X(request): print request.user

Re: Inheritance through a ForeignKey field

2006-11-30 Thread yun
Suppose that you have a Section model that has a foreign key to Magazine, and the field in the Section model is called magazine. You can then do something like this once you get the section: s = Section.objects.select_related.get() s.magazine.id will return the id of the magazine, if it has

Re: Updating multiple models with one form submission

2006-11-28 Thread yun
I can't say that I know the answer since I haven't tried it, yet. In the example that I referenced, the fields were defined and set in the manipulator class. You might be able to to do this as two different forms, that appear on the same page, the javascript may update an ingredient model

Re: Updating multiple models with one form submission

2006-11-28 Thread yun
You can modify multiple models with the same view. I've managed to do it, but involved creating my own manipulator. This isn't nearly as scarry as it sounds, once you understand what's going on. I posted what I did on a http://ssy5.blogspot.com/2006/11/taking-care-of-registration.html;>blog . The

Re: missing auth_user_group and auth_group_permissions tables

2006-11-27 Thread yun
Thanks for the advice. I've checked that the settings.py file was saved before syncing the database. The correct setting file is getting loaded. And finally there is no problem with the PYTHONPATH. The project is the first one shown when using '>>>sys.path'. The tables that were created were:

Re: model question

2006-11-09 Thread yun
In the view you would need to check if the voter has already voted in the poll. If the query is empty, then you can allow the person to vote, if the query contains a record for a particular poll and a particular voter, then you need to redirect them to an "You've already voted on this poll" page.

Re: So I made a forum with Django

2006-11-03 Thread yun
As I'm relatively new to Django (I'm still reading through tutorials and documentation), I was wondering how you managed user authentication. I know that it can be managed throught the auth package, but I was curious how you specifically handled it because I think it was pretty neat.

creating a super user

2006-08-14 Thread yun
I'm currently working through the tutorial using the lastest development verison of django, downloaded from subversion. I've installed django on an Ubuntu 6.06 linux box, and was wondering why I wasn't prompted to create a super user account when I first tryed '>manage.py syncdb'. I ask, because