Re: modelFormSet and csrf

2015-02-24 Thread joulumaa
dd the csrf token, you can use the template tag > {% csrf %} inside the form tag. > And add the submit button before closing the form tag too :) > > On 02/24/2015 01:09 AM, joulumaa wrote: > > Hi, > I just studied and created first modelFormSet, and tried to use it i

modelFormSet and csrf

2015-02-23 Thread joulumaa
Hi, I just studied and created first modelFormSet, and tried to use it in view. I have same code in template as is in django documentation. modelFormset shows data ok, but submit button is missing,why it is not in example template in documentation? ok, I added submit button like I have used with

Communication between listboxes in form

2015-01-22 Thread joulumaa
Hi, beginner question. I need to have two listboxes A and B on web page, When user selects one item from A it should add it in B. If I understand right, form A should somehow save change to database and wake up form B to update its query. Where should I start in documentation? -thanks

Re: Why this code does not change users firstname and lastname?

2015-01-19 Thread joulumaa
+2 Daniel Roseman kirjoitti: > > On Monday, 19 January 2015 09:22:02 UTC, joulumaa wrote: >> >> I have created user earlier in code with email address and password. >> Created users work fine. >> Now in later phase I asked more information and would like to fill i

Why this code does not change users firstname and lastname?

2015-01-19 Thread joulumaa
I have created user earlier in code with email address and password. Created users work fine. Now in later phase I asked more information and would like to fill in first_name and last_name. Code shows old first_name and last_name properly if set in admin view, but logged in user cannot save his

Re: How to check if user is already in user database?

2015-01-16 Thread joulumaa
ah...not exact but exist() perjantai 16. tammikuuta 2015 19.54.44 UTC+2 joulumaa kirjoitti: > > Exception Type: TypeError Exception Value: > > catching classes that do not inherit from BaseException is not allowed > > > Did not work. > Get might be faster than

Re: How to check if user is already in user database?

2015-01-16 Thread joulumaa
Exception Type: TypeError Exception Value: catching classes that do not inherit from BaseException is not allowed Did not work. Get might be faster than filter, but .exact() did not work either -thanks perjantai 16. tammikuuta 2015 19.19.09 UTC+2 Mark kirjoitti: > > Also, you can do a

Re: How to check if user is already in user database?

2015-01-16 Thread joulumaa
tried something like *user = > User.objects.get(username="username")* > > On Saturday, 17 January 2015 00:00:32 UTC+8, joulumaa wrote: >> >> Hi, >> >> If user = auth.authenticate(username,password) results None, I would >> like to create new use

How to check if user is already in user database?

2015-01-16 Thread joulumaa
Hi, If user = auth.authenticate(username,password) results None, I would like to create new user and login it. But I cannot find a way to determine easily if it is was None because of 1) it was not in database or 2) it was in database but password was wrong I addition to those it may have