Re: Multi Database use with statement

2008-12-27 Thread wei guangjing
Please see the attached patch for using in models's Meta option, I also like this option. This patch export some helper function from django.db, get_connection(name) get database connection by name get_current_connection() get current connection you can use follow function to ensure use

Re: Multi Database use with statement

2008-12-27 Thread alex.gay...@gmail.com
Personally I think I like Michael's suggestion of a using method on a queryset, and a default in Meta(pretty much the way ordering works). To his question of reusable applications I think the solution to that is actually something outside the scope of Django itself, a reusable's apps views should

Re: Multi Database use with statement

2008-12-27 Thread mtrier
Hi Wei, On Dec 27, 6:23 am, "wei guangjing" wrote: > Hi, > > I write a patch for using with statement in python 2.5 and up for multi > database access, example code like this: > > # test.py > from __future__ import with_statement > from django.contrib.auth.models import User >

Re: manage.py has x flag turned off

2008-12-27 Thread James Bennett
On Sat, Dec 27, 2008 at 4:18 PM, bedros <2bed...@gmail.com> wrote: > my apologies, django 1.0.2 final does not have x turned on for > manage.py. However, the book I'm reading "Python Web Development with > Django" has the x turned on. It must be that they used a version > before 1.0.2 final. (it

Re: Aggregation branch fails with GIS models.

2008-12-27 Thread Justin Bronn
Ariel, > Is it a gis issue or an aggregation one? As I indicated in private correspondence, this was a matter of updating GeoQuery.get_columns to reflect Russell's aggregation changes. I've attached to #3566 a patch for Russell's git repo that fixes the problem (geoquery_aggregation_fix.diff).

Re: Aggregation branch fails with GIS models.

2008-12-27 Thread alex.gay...@gmail.com
Likely both, I would start by filing a ticket. There's a good bet that one or both sides are making some assumptions that conflict. Alex On Dec 27, 10:08 am, "Ariel Mauricio Nunez Gomez" wrote: > Not sure if this deserves a ticket(yet), but the current aggregation

Re: manage.py has x flag turned off

2008-12-27 Thread bedros
my apologies, django 1.0.2 final does not have x turned on for manage.py. However, the book I'm reading "Python Web Development with Django" has the x turned on. It must be that they used a version before 1.0.2 final. (it covers django 1.0) Thanks On Dec 27, 2:01 pm, bedros

manage.py has x flag turned off

2008-12-27 Thread bedros
I just checked out latest django from trunk and noticed that when I create a project using django-admin.py startproject mysite it does not make manage.py executable. it was executable in 1.0.2 release. I'm not sure if this was an accident, or left out on purpose. it's no big deal, but it may

Re: Using domain in urls.py

2008-12-27 Thread Jeff Anderson
phillc wrote: > different domains = different settings.py = different urls.py > Not necessarily. An apache vhost can have a singe instance of a Django site, and multiple ServerAlias entries could mean that several different DNS names are used to access the same instance of Django.

Re: Using domain in urls.py

2008-12-27 Thread phillc
different domains = different settings.py = different urls.py On Dec 23, 12:30 pm, Dan Ger wrote: > Hi, I have searched to no avail and decided to post here. > > I have a django app that is going to have multiple domain names and > would very much like to use the domain

Aggregation branch fails with GIS models.

2008-12-27 Thread Ariel Mauricio Nunez Gomez
Not sure if this deserves a ticket(yet), but the current aggregation branch in Russell's git hub repository fails with default manager django.contrib.gis.db.models.GeoManager {{{ #models.py from django.contrib.gis.db import models class SimpleModel(models.Model): pass class

Multi Database use with statement

2008-12-27 Thread wei guangjing
Hi, I write a patch for using with statement in python 2.5 and up for multi database access, example code like this: # test.py from __future__ import with_statement from django.contrib.auth.models import User from django.db import using with using('db1'): print User.objects.count() # db1