Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread kenneth gonsalves
On Wed, 2011-09-21 at 19:37 +0100, Cal Leeming [Simplicity Media Ltd] wrote: > Oh jeez - modpython, I've nfi how to make that work with the same > approach. Maybe check mod_python docs?? apachectl graceful - no other way. -- regards Kenneth Gonsalves -- You received this message because you are

Is there any particular reason why it's assumed you won't be performing a Max on a CharField?

2011-09-21 Thread Joshua Russo
Is there any particular reason why it's assumed you won't be performing a Max on a CharField? I tried to create the following QuerySet: Document.objects.filter(documentType=1, event__eventType=3).annotate(event_date=Max('event__start_date'), subcommittee=Max('event__subcommittee__name')).orde

Re: Customizing forms html

2011-09-21 Thread Russell Keith-Magee
On Thu, Sep 22, 2011 at 2:19 AM, Jacob G wrote: > I'm trying to customize Django forms html based on three requirements: > 1) Html output to match html given to me by a web site designer. > 2) Automatically generate forms, so I don't have to duplicate html in > templates. > 3) Re-use as match of D

Re: TransactionMiddleware recommendation

2011-09-21 Thread Joe Mou
Thanks, really interesting read. On Wed, Sep 21, 2011 at 3:42 PM, Christophe Pettus wrote: > > On Sep 21, 2011, at 2:27 PM, Joseph Mou wrote: > > > Why is this preferable over the default auto-commit behavior? > > If you are certain that every single time you modify the database, you want > an i

Re: User Registration -> Password not saving

2011-09-21 Thread Kurtis
I didn't realize the code would come out so unreadable. It's also posted here: http://dpaste.com/618619/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this

Re: TransactionMiddleware recommendation

2011-09-21 Thread Christophe Pettus
On Sep 21, 2011, at 2:27 PM, Joseph Mou wrote: > Why is this preferable over the default auto-commit behavior? If you are certain that every single time you modify the database, you want an immediate commit (no object graphics, no possibility of dangling objects), the default behavior might wo

User Registration -> Password not saving

2011-09-21 Thread Kurtis
Hey, I've created my own User Registration FormView. Everything seems to work great except the password is always saved as "!". I can change that with the "password changer" in the admin section of the site. I am using an alternative authentication backend, so I'm not sure if that was causing prob

TransactionMiddleware recommendation

2011-09-21 Thread Joseph Mou
I saw that the docs recommend using TransactionMiddleware, even though it's not the default: https://docs.djangoproject.com/en/dev/topics/db/transactions/ Why is this preferable over the default auto-commit behavior? I wasn't able to find much more information when searching (mostly just bug repor

Re: Django template IndexError

2011-09-21 Thread Martin Tiršel
It seems, that Django handles methods and variables indexes differently. So I solved it this way: e = IndexError() e.silent_variable_failure = True raise e Martin On Wed, 21 Sep 2011 23:36:58 +0200, Martin Tiršel wrote: Hello, I have this situation: class SomeClass(object): ...

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Cal Leeming [Simplicity Media Ltd]
http://blip.tv/djangocon/deployment-daemons-and-datacenters-5573370 This is quite interesting - props to Godwin for this On Wed, Sep 21, 2011 at 10:56 PM, Shawn Milochik wrote: > On Wed, Sep 21, 2011 at 5:54 PM, Marc Aymerich > wrote: > > On Wed, Sep 21, 2011 at 11:46 PM, David Watson > wrote

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Shawn Milochik
On Wed, Sep 21, 2011 at 5:54 PM, Marc Aymerich wrote: > On Wed, Sep 21, 2011 at 11:46 PM, David Watson > wrote: >> Looks like they are online now http://blip.tv/djangocon >> regards, >> David >> > > Wow, great news!! I'm going to check it out right now :) > Awesome. They're not all there, but

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Marc Aymerich
On Wed, Sep 21, 2011 at 11:46 PM, David Watson wrote: > Looks like they are online now http://blip.tv/djangocon > regards, > David > Wow, great news!! I'm going to check it out right now :) > On Wed, Sep 21, 2011 at 2:21 PM, Jason Keene wrote: >> >> I agree, was hoping these would already be up

Re: DjangoCon US 2011 Videos

2011-09-21 Thread David Watson
Looks like they are online now http://blip.tv/djangocon regards, David On Wed, Sep 21, 2011 at 2:21 PM, Jason Keene wrote: > I agree, was hoping these would already be up. We should all tweet > @nextdayvideo see if we can elicit a > response. > > > > On Wed

Django template IndexError

2011-09-21 Thread Martin Tiršel
Hello, I have this situation: class SomeClass(object): ... def __getitem__(self, key): ... raise IndexError() and now: context['somevar'] = {'one': 1, } context['anothervar'] = SomeClass() in template: {{ somevar.one }} - prints 1 {{ somevar.two }} - prints nothing,

Re: Comment Framework and Session Variables

2011-09-21 Thread Andres Reyes
One possible way would be to create your own template tag and use it instead of the provided one. I did it recently and it's not that complicated, you should use the code for the current one as an starting point and just extend it to accept some custom parameter you provide, in this case the email

Re: Using success_url with reverse() in class-based generic view

2011-09-21 Thread Xavier Ordoquy
Hi, You can also use get_success_url for that: class ContactView(generic.FormView): form_class = ContactForm def get_success_url(self): return reverse('contact-sent') Regards, Xavier Linovia. Le 21 sept. 2011 à 00:08, Daniel P a écrit : > Same problem. You'r not alone! > > t

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread Daniel Roseman
On Wednesday, 21 September 2011 19:25:08 UTC+1, vijaymohan wrote: > > i did't modify httpd.conf > i just included the below line in /etc/httpd/conf.d/python.conf > > LoadModule python_module modules/mod_python.so > > > SetHandler python-program > PythonHandler django.core.handlers.modpytho

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread Cal Leeming [Simplicity Media Ltd]
Oh jeez - modpython, I've nfi how to make that work with the same approach. Maybe check mod_python docs?? Cal On Wed, Sep 21, 2011 at 7:25 PM, vijaymohan wrote: > i did't modify httpd.conf > i just included the below line in /etc/httpd/conf.d/python.conf > > LoadModule python_module modules/mod

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread vijaymohan
i did't modify httpd.conf i just included the below line in /etc/httpd/conf.d/python.conf LoadModule python_module modules/mod_python.so SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonOption django.root /

Comment Framework and Session Variables

2011-09-21 Thread SixDegrees
I'm using the Django-supplied comment framework, and I would like to initialize the email field of the comment form with a value stored in a session variable. The forms, however, are created using template tags; they aren't instantiated in the view, for example, where I could easily provide the se

Re: Customizing forms html

2011-09-21 Thread Jacob G
And I also want to display non-field errors after the form, not before. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/66g7i8P5DqEJ. To post to this group,

Customizing forms html

2011-09-21 Thread Jacob G
I'm trying to customize Django forms html based on three requirements: 1) Html output to match html given to me by a web site designer. 2) Automatically generate forms, so I don't have to duplicate html in templates. 3) Re-use as match of Django forms code as possible. For my first attempt, I'm w

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, I should have been more clear on this. In your apache config, you should have specified a WSGI file to attach to (assuming you are using WSGI) - this is the file you need to touch. If not, please specify how you are telling Apache to connect to your python app. Cal On Wed, Sep 21, 2011

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread vijaymohan
i am in very early stage of learning django. if you don't mind could you tell me what the bootstrapper is ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-

Re: How to solve MultiValueDictKeyError

2011-09-21 Thread Jacob Kaplan-Moss
On Wed, Sep 21, 2011 at 5:43 AM, Tom Evans wrote: > On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi wrote: >> Hello friends, >> >> I don't know why Django is so unstable. > > I don't know why you cross posted this to django-developers. Tom, the snarky tone is un-called-for and not OK. Cross-pos

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread Cal Leeming [Simplicity Media Ltd]
Yeah that won't work. You need to 'touch' your bootstrapper. Cal On Wed, Sep 21, 2011 at 6:24 PM, vijaymohan wrote: > [vijay]$ cd /var/www/html/mysite/ > [vijay mysite]$ ls > __init__.py manage.py settings.py templates urls.py views.py > > modified views.py file. > > -- > You received thi

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread vijaymohan
[vijay]$ cd /var/www/html/mysite/ [vijay mysite]$ ls __init__.py manage.py settings.py templates urls.py views.py modified views.py file. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://gro

Re: Getting a count of a RawQuerySet object

2011-09-21 Thread dm03514
If you're writing your own queries, can't you just write a count query?? or when you're iterating over your results just keep the count??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegr

Re: Getting a count of a RawQuerySet object

2011-09-21 Thread Jack Morgan
Hi, thanks! The issue I'm getting here is that the RawQuerySet object does not have the .count() method so it just gives an error. I also just checked that it does not have the 'all()' method either. On Wed, Sep 21, 2011 at 9:23 AM, wrote: > Let's say you have a model Utility, you can do > Util

Re: Custom model field/form: __init__() got multiple values for keyword argument 'baz'

2011-09-21 Thread Micky Hulse
On Wed, Sep 21, 2011 at 6:08 AM, Michal Petrucha wrote: > The remedy is simple, instead of kwargs.get use kwargs.pop. Ahhh, I see! Thanks so much for the explanation and clarification. Much appreciated. Have an excellent day! Cheers, Micky -- You received this message because you are subscri

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread Cal Leeming [Simplicity Media Ltd]
May I ask which file you are attempting to 'touch'? You can only do it on the bootstrapper. Cal On Wed, Sep 21, 2011 at 5:58 PM, vijaymohan wrote: > i am using Apache, touch approach is not working for me.Is there any change > i need to make in httpd.conf ? > > -- > You received this message be

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread vijaymohan
i am using Apache, touch approach is not working for me.Is there any change i need to make in httpd.conf ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-

Re: changes to .py file is not reflected until server is restarted.

2011-09-21 Thread Cal Leeming [Simplicity Media Ltd]
Hi Vijay, Some web app servers will allow you to 'touch' the wrapper file (wsgi.py for example) which will in turn trigger a restart. Running manage.py in 'runserver' mode will also do this (this is for dev, NOT for production). But for the most part, production will require you to restart the we

Re: Getting a count of a RawQuerySet object

2011-09-21 Thread delegbede
Let's say you have a model Utility, you can do Utility.objects.all().count() Hope that helps. Regards. Sent from my BlackBerry wireless device from MTN -Original Message- From: Jack Sender: django-users@googlegroups.com Date: Wed, 21 Sep 2011 09:10:49 To: Django users Reply-To: django-

changes to .py file is not reflected until server is restarted.

2011-09-21 Thread vijaymohan
I am new to django and did't find solution googling. i changed a .py file in my app and hit refresh button on web browser but the changes are not reflected until i restart the httpd. is there any flag i need to set this to happen. I set PythonAutoReload On in python.conf. Changes to template file

Getting a count of a RawQuerySet object

2011-09-21 Thread Jack
Hello everyone, I'm quite new to django and python in general so I'm sure there's just something I missed in my searching to answer this. But... Is there a way to count the number of results returned in the RawQuerySet option? I've tried the len() function and I've search the django documentation

Re: request.method not working as expected

2011-09-21 Thread Fabio Natali
On 09/21/2011 03:32 PM, Fabio Natali wrote: [...] Yes, I'll follow Andres Reyes advice and use {% url %} tag. I'm still having a few problems with it, but it sounds like the way to go. Ok, it works now. I just had to use the proper syntax! :-) ### urls.py ... url(r'^add_to_cart/$', add_to_cart

Re: Using success_url with reverse() in class-based generic view

2011-09-21 Thread Daniel P
Same problem. You'r not alone! this is also a solution: http://djangosnippets.org/snippets/2445/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group,

Re: Where does form.is_valid() clean the form?

2011-09-21 Thread Jacob G
Thanks all. I figured out my mess-up: In the view, I instantiated the form incorrectly as follows: form = AuthenticationForm(request.POST) Instead of the correct way: form = AuthenticationForm(request, data=request.POST) The debugger weirdness distracted me from the real problem. I still don

Re: Is it possible to run from Django script?

2011-09-21 Thread Malcolm Box
On 20 September 2011 21:36, Stone wrote: > Dear users, > > I have simple question which regards with running script from view.py. > > Is it possible to do that over subprocess command? > > Yes, you can run a script from within your view. Whether you *should* or not depends largely on how long th

Re: request.method not working as expected

2011-09-21 Thread Fabio Natali
On 09/21/2011 09:37 AM, Babatunde Akinyanmi wrote: Your post showed the trailing url... Yes! You are perfectly right, it was my fault! (But you have to admit it was hard to find, that little trailing slash! :-)) anyway I agree with your diagnosis. [...] Yes, I'll follow Andres Reyes advic

Re: request.method not working as expected

2011-09-21 Thread Fabio Natali
On 09/21/2011 09:39 AM, Babatunde Akinyanmi wrote: What's in your add_to_cart view function? Hi Babatunde, at the moment, the add_to_cart view is just printing the POST data on the screen. Cheers, Fabio. -- Fabio Natali FNstudio http://fnstudio.it fabio_natali@skype -- You received this m

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Jason Keene
I agree, was hoping these would already be up. We should all tweet @nextdayvideo see if we can elicit a response. On Wed, Sep 21, 2011 at 9:12 AM, Derek wrote: > +2 > > On Sep 21, 3:10 pm, "Cal Leeming [Simplicity Media Ltd]" > wrote: > > +1 > > > > On Wed,

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Derek
+2 On Sep 21, 3:10 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > +1 > > On Wed, Sep 21, 2011 at 2:09 PM, Slafs wrote: > > I would be interested also in watching those videos > > > Regards > > >  -- > > You received this message because you are subscribed to the Google Groups > > "Django user

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Cal Leeming [Simplicity Media Ltd]
+1 On Wed, Sep 21, 2011 at 2:09 PM, Slafs wrote: > I would be interested also in watching those videos > > Regards > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Brian Bouterse
Me 2. I was at the conference but missed one or two key sessions that I wanted to see. Brian On Wed, Sep 21, 2011 at 9:09 AM, Slafs wrote: > I would be interested also in watching those videos > > Regards > > > -- > You received this message because you are subscribed to the Google Groups > "

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Slafs
I would be interested also in watching those videos Regards -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/C0sVOMIzq3UJ. To post to this group, send email

Re: Custom model field/form: __init__() got multiple values for keyword argument 'baz'

2011-09-21 Thread Michal Petrucha
On Tue, Sep 20, 2011 at 04:18:28PM -0700, Micky Hulse wrote: > Optimally, I think I would prefer to keep the verbose name in the > first position (as an arg, not kwarg) in order to keep things > consistent. > > If you look at fields.py: > > > > Li

Re: mysql installation error

2011-09-21 Thread Thorsten Sanders
When I first installed django, that made me going crazy to try to install that library, in the end I just went with a pre-compiled from http://www.lfd.uci.edu/~gohlke/pythonlibs/ On 21.09.2011 04:59, PremAnand Lakshmanan wrote: Hi, When I try to install mysql I get the following error, Pls pro

Re: How to solve MultiValueDictKeyError

2011-09-21 Thread Florian Apolloner
Hi, please post in django-users, this mailinglist is about the development of django itself, not about enduser problems. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/

Re: How to solve MultiValueDictKeyError

2011-09-21 Thread Kayode Odeyemi
On Wed, Sep 21, 2011 at 11:43 AM, Tom Evans wrote: > > On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi > wrote: > > curl -v -H "Content-Type: application/json" -A 'Mozilla' -X POST --data > > 'fees={"fees":{"status":"pending","timeout":5}, > > "hostel":{"status":"pending","timeout": 3}}' > > htt

Re: How to solve MultiValueDictKeyError

2011-09-21 Thread Kayode Odeyemi
On Wed, Sep 21, 2011 at 11:43 AM, Tom Evans wrote: > On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi > wrote: > > Hello friends, > > > > I don't know why Django is so unstable. > > I don't know why you cross posted this to django-developers. > My apologies for cross-posting. (My hands to my che

Re: How to solve MultiValueDictKeyError

2011-09-21 Thread Tom Evans
On Wed, Sep 21, 2011 at 11:33 AM, Kayode Odeyemi wrote: > Hello friends, > > I don't know why Django is so unstable. I don't know why you cross posted this to django-developers. > > Before restarting my computer everything works fine. Django could parse a > simple > POST request without complain

How to solve MultiValueDictKeyError

2011-09-21 Thread Kayode Odeyemi
Hello friends, I don't know why Django is so unstable. Before restarting my computer everything works fine. Django could parse a simple POST request without complaining KeyError. I'm simply making a POST request like this: curl -v -H "Content-Type: application/json" -A 'Mozilla' -X POST --data

Re: Create socket server in django

2011-09-21 Thread Micke
Wow. I will try, and if it works as you say, its wonderful! :) On Sep 20, 12:26 pm, Thorsten Sanders wrote: > import sys,os > > sys.path.append('/path/to/your/django_project') > os.environ['DJANGO_SETTINGS_MODULE'] = 'your_settings_file' > > This works fine for a cronjob I created > > On 20.09.2

Re: request.method not working as expected

2011-09-21 Thread Babatunde Akinyanmi
What's in your add_to_cart view function? On 9/21/11, Fabio Natali wrote: > On 09/21/2011 07:57 AM, Andres Reyes wrote: >> I believe that the best practice is to always use the {% url %} template >> tag and not hardcoding your URL's > > That makes perfect sense. Thanks for your precious tip! > >

Re: request.method not working as expected

2011-09-21 Thread Babatunde Akinyanmi
Your post showed the trailing url...anyway I agree with your diagnosis. With my noob knowledge of django, django tries to add a trailing slash to your url when you don't. I believe she does that by adding the trailing slash to the url and then asking the server to redirect to the url which is the r