Re: manage.py ignores DJANGO_SETTINGS_MODULE

2010-07-04 Thread Graham Dumpleton
Also read: http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html where I explain a bit about startup steps. Graham On Jul 5, 4:25 pm, "euan.godd...@googlemail.com" wrote: > If you read the source for django.core.management.__init__ you'll find > a function called "setup_envir

Re: New Django tutorial

2010-07-04 Thread euan.godd...@googlemail.com
Glad to be of assistance. Let me know when it's finished or if you want another look over, Euan On 3 July, 15:22, Rainy wrote: > Thanks for great feedback, Euan. I've added some comments below. > > On Jul 3, 8:26 am, "euan.godd...@googlemail.com" > > wrote: > > I had a look over your tutorial a

Re: GROUP BY and ORDER BY using the ORM

2010-07-04 Thread euan.godd...@googlemail.com
Erm. You don't seem to have specified what to order by. In this case, surely you want ... .order_by('date_time') However, this field doesn't seem to appear in your models. One thing I've found handy for debugging Django's ORM to SQL is something which I don't think is documented in django docs at

Re: manage.py ignores DJANGO_SETTINGS_MODULE

2010-07-04 Thread euan.godd...@googlemail.com
If you read the source for django.core.management.__init__ you'll find a function called "setup_environ. This is called by all management commands (i.e. manage.py). If you note here the os.environ is set unconditionally. I suppose for your setup to work correctly django should be doing: if not "DJ

ModelAdmin with tabularinline Question

2010-07-04 Thread SilverFox
I am trying to write an application that credits a user's account when a bet is paid. I have an admin form with the bet and a TabularInline list of bet choices (the choices that can be bet on). To resolve a bet a ModelAdmin is used to set the status of the bet to True (paid) and the winner field on

manage.py ignores DJANGO_SETTINGS_MODULE

2010-07-04 Thread ShawnMilo
I have DJANGO_SETTINGS_MODULE set in my environment to an alternative settings file. The alternate file imports the original settings file and overrides some values for my development environment. Whenever I try to run ./manage.py runserver, it insists on using the settings.py on the same path as

Re: *Immediate* session expiration problem/bug in IE

2010-07-04 Thread ShawnMilo
I have an update. It turns out that setting the timeout in set_expiry to a much larger value prevents the immediate timeout. Of course, this means that people in well-behaved browsers won't time out when they should. This is despite the fact that I've tried sending both an integer (for seconds) and

Re: db_schema support was broken by Debian upgrade: 'class Meta' got invalid attribute(s): db_schema

2010-07-04 Thread Ramiro Morales
On Sun, Jul 4, 2010 at 5:39 PM, MiddleForkGIS wrote: > During an update of Debian ("squeeze/sid") last week, something broke > the previously functional Postgresql schema syntax on my site(s). > > Up until the update, this was working fine: > > class Meta: >  db_schema = "world" >  db_table = "cou

db_schema support was broken by Debian upgrade: 'class Meta' got invalid attribute(s): db_schema

2010-07-04 Thread MiddleForkGIS
During an update of Debian ("squeeze/sid") last week, something broke the previously functional Postgresql schema syntax on my site(s). Up until the update, this was working fine: class Meta: db_schema = "world" db_table = "country" Once I performed the update, the following error occurs: F

django.utils.functional.__proxy__ object

2010-07-04 Thread vanderkerkoff
Evening all I've just moved a really old django project of ours over to a new machine, newer python, and newer mysql. I'm using a mentally old version of django, revision 5783. The move has gone tickety boo, we're using nginx instead of lighttpd as well. The only oddity I've got is that in the

problems accessing to media.djangoproject.com - perhaps from argentina ?

2010-07-04 Thread Aldo Nievas
Hi anone else have had problem with media.djangoproject.com ? /.virtualenvs/site.com/bin# ./easy_install django Searching for django Reading http://pypi.python.org/simple/django/ Reading http://www.djangoproject.com/ Best match: Django 1.2.1 Downloading http://media.djangoproject.com/releases/1.2/

break/continue for templates

2010-07-04 Thread George Sakkis
Hi all, there have been at least three threads in this list alone from people asking how to "break" from a for loop in templates, so the following snippet [1] might be useful to some. Leaving aside the "thou shalt not use logic in templates" religious debate, it's interesting in that it is syntact

Debugging Django under wsgi and pydev

2010-07-04 Thread Doug Warren
Is there a way to run a django app that's being served on the local machine via Apache and mod_wsgi using the integrated debugger in wsgi? I did a few google searches but nothing popped out as being the obvious solution, other than a suggestion from google to run apache httpd -x which I'd take as

Re: Different fieldsets in django admin for add and change?

2010-07-04 Thread Daniel Roseman
On Jul 4, 4:04 pm, Aziz Bookwala wrote: > Hello World > I wanted to know how to implement different fieldsets for the add and change > pages in django admin like a lot of applications do (django-cms for ex) > Any help would be much appreciated. > > -- > - Aziz M. Bookwala You can override the `ge

Re: How set initial form field value in the view function?

2010-07-04 Thread Jim
> The initial keyword is great when defining a subclass of Form if you > the initial values is ALWAYS the same. > > What if it varies?...I'm guessing I must set it in the view. From: http://docs.djangoproject.com/en/1.2/ref/forms/api/#dynamic-initial-values we have: Dynamic initial values¶ F

messages framework: disable caching?

2010-07-04 Thread Torsten Bronger
Hallöchen! I wonder whether it makes sense to disable caching in responses which used messages from the messages framework. Since they are consumed by displaying them, I don't see a point in letting upsteam caches to cache the page. I added if request._messages.used: add_never_cache

How set initial form field value in the view function?

2010-07-04 Thread Chris Seberino
How set initial form field value in the view function? The initial keyword is great when defining a subclass of Form if you the initial values is ALWAYS the same. What if it varies?...I'm guessing I must set it in the view. How set this initial value in the view? Chris -- You received this me

Different fieldsets in django admin for add and change?

2010-07-04 Thread Aziz Bookwala
Hello World I wanted to know how to implement different fieldsets for the add and change pages in django admin like a lot of applications do (django-cms for ex) Any help would be much appreciated. -- - Aziz M. Bookwala -- You received this message because you are subscribed to the Google Groups

filtering admin data

2010-07-04 Thread djnubbio
hi all; sorry for wasting your preciouse tume. I'm trouble with the following: class A(models.Model): . . . class B(models.Model): . . . a= models.ForeignKey(A) class C(models.Model): . . . b= models.ForeignKey(B) How can i filter data that belongs to an A instance, while editing class C in

Re: How to get a model instance's field var while field's name is a string in template?

2010-07-04 Thread David.D
It work! Thank you. On Jul 4, 9:30 pm, Daniel Roseman wrote: > On Jul 4, 12:01 pm, "David.D" wrote: > > > i mean > > i have a model instance m, and m has a field fd. > > so i can wrote like this in template > >    {{ m.fd }} > > > but, when i got a string  s = "fd" > > > how could i do the same

Re: How to get a model instance's field var while field's name is a string in template?

2010-07-04 Thread Daniel Roseman
On Jul 4, 12:01 pm, "David.D" wrote: > i mean > i have a model instance m, and m has a field fd. > so i can wrote like this in template >    {{ m.fd }} > > but, when i got a string  s = "fd" > > how could i do the same as above? > > thanks for any help... There's no built-in way. A simple custom

Re: Problem with L10N of DecimalField

2010-07-04 Thread Simon Westphahl
I figured out a way to get it working. ### models.py [...] class DecTest(models.Model): dec = models.DecimalField(max_digits=8, decimal_places=2) class LocalDecForm(forms.ModelForm): dec = forms.DecimalField(max_digits=8, decimal_places=2, localize=True) class Meta: model = De

How to get a model instance's field var while field's name is a string in template?

2010-07-04 Thread David.D
i mean i have a model instance m, and m has a field fd. so i can wrote like this in template {{ m.fd }} but, when i got a string s = "fd" how could i do the same as above? thanks for any help... -- You received this message because you are subscribed to the Google Groups "Django users" gr

Problem with (possible bug?) with the random number generator in django/middleware/csrf.py

2010-07-04 Thread DanEE
Hello all I experienced a strange behaviour with my django application when I wanted to deploy and test on my apache instance on my virtual server. I could successfully deploy my application but when I wanted to access any view the browser just took forever to load and it never showed the view. Ac

Re: Problem with L10N of DecimalField

2010-07-04 Thread Simon Westphahl
For clarification: The output in the admin list view is properly localized. Only the input doesn't work. I'm using Django 1.2.1 and a almost vanilla Django project only with this one test app installed. On 3 Jul., 22:07, Simon Westphahl wrote: > Hi, > > I tried to implement a localized "DecimalFi

Re: Sample Django AppEngine App

2010-07-04 Thread Floh
On Sat, Jul 3, 2010 at 8:00 AM, Gath wrote: > Won't it be nice to start first by learning Django! From my experience > Django was not build to run on top of AppEngine. There are alot of > hacks on django to make run on AppEngine that might confuse a > beginner, e.g Django was built to run on relat