Self Join

2010-03-12 Thread jrs
I'm trying, without a great deal of success, to perform a simple self join using the django orm. I'm pretty sure the F() function is not the answer. I believe this only allows you to compare two field within the same model instance, not to compare fields within 2 instances of the same model. I w

Re: Self Join

2010-03-15 Thread jrs
I see nothing on this page that is in the slightest bit related to my question... Does anyone know if there is a way in the django orm to accomplish my query above? Thanks. On Mar 13, 4:17 am, Daniel Roseman wrote: > On Mar 12, 10:54 pm, jrs wrote: > > > > > I'm trying,

Re: Self Join

2010-03-15 Thread jrs
It's quite easy to produce some nasty queries in loops. I'm guessing the if the simply query above can't be accomplished that I'm better off trying straight sql or sql alchemy. On Mar 15, 11:21 am, Daniel Roseman wrote: > On Mar 15, 1:40 pm, jrs wrote: > > >

Django ORM

2010-03-23 Thread jrs
I have a statement--- Container.objects.get( pk=container_id ).delete() This seemingly trivial operation hammers the db with 581 queries!! The reason being that the django orm has decided that it will enforce referential integrity as a default behavior. As you could imagine, thi

Re: Django ORM

2010-03-23 Thread jrs
On Mar 23, 10:05 am, "ge...@aquarianhouse.com" wrote: > Filter would be better :) > > Container.objects.filter( >           pk=container_id >      ).delete() Why is filter better here, since it's a one record delete? Also, am I correct is believing that this creates a painfully easy way to bri

Re: Django ORM

2010-03-23 Thread jrs
Thanks Russ On Mar 23, 10:33 am, Russell Keith-Magee wrote: > On Tue, Mar 23, 2010 at 10:21 PM, jrs wrote: > > > On Mar 23, 10:05 am, "ge...@aquarianhouse.com" > > wrote: > >> Filter would be better :) > > >> Container.objects.filter(

Disabling Messaging

2010-03-23 Thread jrs
Is there a flag somewhere which will allow me to disable django messaging? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: Django ORM

2010-03-23 Thread jrs
Russ and Javier, Just to be clear... the reason for my initial note was due to my already having a work queue which performs cleanup and maintains data integrity. It is precisely due to this that I'm surprised the ORM has cascading deletes on by default. Seems to me that cascades should only hap

Re: Disabling Messaging

2010-03-23 Thread jrs
h_message`.`user_id` = 1 '} is being run. I can't figure out how I can stop this unnecessary database activity. On Mar 23, 2:20 pm, Preston Holmes wrote: > On Mar 23, 8:20 am, jrs wrote: > > > Is there a flag somewhere which will allow me to disable django > > messa

Re: Django ORM

2010-03-23 Thread jrs
Clifford, Ask the previous engineering staff of Twitter if it's dangerous. On Mar 23, 5:26 pm, CLIFFORD ILKAY wrote: > On 03/23/2010 04:57 PM, jrs wrote: > > > Russ and Javier, > > > Just to be clear... the reason for my initial note was due to my > > already ha

Re: Django ORM

2010-03-23 Thread jrs
early than I've been able to! On Mar 23, 5:56 pm, James Bennett wrote: > On Tue, Mar 23, 2010 at 3:57 PM, jrs wrote: > > It is precisely due to this that I'm surprised the ORM has > > cascading deletes on by default.  Seems to me that cascades should > > only happen

Re: Disabling Messaging

2010-03-24 Thread jrs
I'm using 1.1.1 now. Any idea when there will be a 1.1.2 release? Is the current branch considered stable? Thanks Russ. On Mar 23, 8:12 pm, Russell Keith-Magee wrote: > On Wed, Mar 24, 2010 at 5:01 AM, jrs wrote: > > Thanks Preston. > > > I'm not using djan

Re: Django ORM

2010-03-24 Thread jrs
> Sorry to have to say the last part is pure nonsense. Preserving data > integrity is of course the only sane default behaviour. How could NOT > preserving data integrity be "dangerous" ??? looonng query ? And ? So > what ? You are supposed to know your data model, don't you ? Bruno, I'm assuming

fieldsets in newforms

2007-10-03 Thread jrs
I am trying to use fieldsets and newforms, looking at the newforms- admin branch it appears as if support will be included in the admin, but I am not sure of how to integrate this into my custom forms. Is the following possible / are there plans for doing something like the following? {{ form.a

Re: not receiving error email

2007-01-31 Thread jrs
Have you tried the SERVER_EMAIL setting in settings.py? For me that did the trick SERVER_EMAIL = '[EMAIL PROTECTED]' Without that it was sending the exception emails from [EMAIL PROTECTED] which my shared provider (webfaction which I highly recommend) did not like. jrs On Jan 3

Re: hide drop-down items with generic views?

2006-07-27 Thread jrs
I have used custom manipulators to do this http://www.djangoproject.com/documentation/forms/ class PollAddManipulator(Poll.AddManipulator): def __init__(self, season): super(Poll.AddManipulator, self).__init__() newfields = [] for field in

Re: DateTimeField

2006-07-27 Thread jrs
I believe you need 2 fields on your form: {{form.EndTime.time}} and {{form.EndTime.date}} --~--~-~--~~~---~--~~ 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@goog

Re: simple search pagination

2006-08-10 Thread jrs
submit.x and submit.y are the coordinates of where the user clicked the submit image. --~--~-~--~~~---~--~~ 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@googlegro

Re: Table prefix problems

2006-09-01 Thread jrs
I actually looked into this yesterday and came up with the following modification to db/models/options.py around line 37 def __setattr__(self, name, value): if (settings.DB_PREFIX != '' and name == 'db_table' and value != ''): self.__dict__[name] = DB_PREFIX + "_" + value else:

Re: TEMPLATE_DIRS relative to project?

2006-04-16 Thread jrs
I have solved this by using a settings_env.py file. At the top of my settings.py file I have from settings_env import * then inside settings_env.py I define MY_BASE_PATH = /absolute/path/to/project/ so that inside settings.py the template becomes TEMPLATE_DIRS = ( MY_BASE_PATH + 'templates