Re: verify before make changes?

2013-09-01 Thread Dan Gentry
Seems to me your call to get_object_or_404() would effectively check for the object's existence. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-us

Re: Why does the save form order make any difrance?

2013-09-01 Thread Harjot Mann
On Sun, Sep 1, 2013 at 1:35 AM, Gerd Koetje wrote: > if u need to see any other code let me know You need to save it below each line and u need to use for loop for iterating all the forms. -- Harjot Kaur Mann Blog: http://harjotmann.wordpress.com/ Daily Dairy: http://harjotmann.wordpress.com/dai

Re: Why does the save form order make any difrance?

2013-09-01 Thread Gerd Koetje
so like this? Can u tell me why this have to be this way? form = ProfielenForm(request.POST, instance=request.user.profile) if form.is_valid(): form.save() form2 = ProfielenForm2(request.POST, instance=request.user.profile) if form2.is_valid(): form2.save() form3 = ProfielenForm3(request

Re: Script to move django 1.4.3 to 1.5.1

2013-09-01 Thread Sam Walters
The worst change i've had to make was a long time ago when we had to send CSRF Token with Ajax calls because of a security exploit. Had to write an entire regular expression and apply it to multiple template files. Took perhaps 40 minutes. However i can see some of the really old django snippets o

how to serialize django form?

2013-09-01 Thread xliiv
How to serialize django form (django.forms.Form)? I'd like to remember user's choices put in a form. Or maybe there is better solution? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

Passing initial values to a form

2013-09-01 Thread Drew Ferguson
Hi I have gotten myself badly confused today trying to figure this out. If I have these elements # urls.py url(r'^banker/(?P\d+)/iac$', view = IacCreateView.as_view()) # views.py class IacCreateView(LoginRequiredMixin, CreateView): template_name = 'iaccount_form.html' model = Iaccount

Re: Passing initial values to a form

2013-09-01 Thread Thomas Orozco
The URL parameter (iid) is accessible in your view in self.kwargs["iid"]. You can pass it to the form by overriding your view's `get_initial` method ( https://github.com/django/django/blob/1.6b2/django/views/generic/edit.py#L22 ) `get_initial` should return a dict, and you should use: { 'na

Re: how to serialize django form?

2013-09-01 Thread xliiv
Good old pickle module deal it. The answer is: 'use pickle' :) On Sunday, September 1, 2013 6:16:20 PM UTC+2, xliiv wrote: > > How to serialize django form (django.forms.Form)? > I'd like to remember user's choices put in a form. > Or maybe there is better solution? > > -- You received this mess

Re: Passing initial values to a form

2013-09-01 Thread Drew Ferguson
Perfect, thanks On Sun, 1 Sep 2013 18:44:07 +0200 Thomas Orozco wrote: > The URL parameter (iid) is accessible in your view in self.kwargs["iid"]. > > You can pass it to the form by overriding your view's `get_initial` > method > ( https://github.com/django/django/blob/1.6b2/django/views/generi

Re: Django driving me nuts

2013-09-01 Thread Gerd Koetje
thanks will use the irc -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-us

Django logs for the website

2013-09-01 Thread Alek Uritsky
Hi all, does Django/Python has a standard logs system? I am trying to find the logs generated by the website, so far was able to find only the webserver logs (nginx). Is there a standard place where a Python website developer would put website specific logs? thanx -- You received this message

Re: Django driving me nuts

2013-09-01 Thread Alexis Bellido
It seems like you haven't read the documentation. That's the best place to start. Also, as Lloyd already said, you should offer more details about your problem. If you are coming from another programming language or frameworks, you mentioned PHP, you should try to stop comparing and doing thin

Re: list(form) makes my form not safe anymore

2013-09-01 Thread Lloyd Dube
Hi Gerd, I have been following your question quite closely and I wish to find a way to assist. Are you creating multiple forms? If so, are you using Formsets? I need to understand what exactly you want to accomplish before I can render any assistance. Sithu On Saturday, August 31, 2013 4:13:2

Re: Django logs for the website

2013-09-01 Thread Christiano Anderson
By default, a Django application doesn't log everything, except 500 errors. You can also check the access.log and error.log of your Nginx or WSGI system. If you want a more verbose logging system, take a look at: https://docs.djangoproject.com/en/dev/topics/logging/ On 1 September 2013 14:21,

Re: Django logs for the website

2013-09-01 Thread Kelvin Wong
It depends on how you're running your Django app. If you are running this under Apache mod_wsgi, they end up in the Apache error.log file. If you are running this under Gunicorn/Supervisor with an Nginx out in front then I've seen them show up in the Supervisor log file. I've also seen them emi

Re: Django-registration reset password templates not getting picked up

2013-09-01 Thread Kelvin Wong
TEMPLATE_DIRS needs to have the location of the templates. As long as those templates are being picked up and one is called 'password_reset_form.html' it should work. One of my apps has this form at: /my_project/templates_global/registration/password_reset_form.html In /my_project/my_project/s

Re: Why does the save form order make any difrance?

2013-09-01 Thread Daniel Roseman
On Sunday, 1 September 2013 17:09:11 UTC+1, Gerd Koetje wrote: > so like this? > Can u tell me why this have to be this way? > > > You should be using formsets if you have multiple identical forms on one page. Formsets: https://docs.djangoproject.com/en/1.5/topics/forms/formsets/ Model formsets