Re: Bug with Foo.objects.get_or_create

2006-06-12 Thread m h
hmmm, it appears to sort of work with I add the .id attribute category. But on another object that also uses a foreign key, it won't work It still seems like a bug and is confusing. Why should the interface change on a convenience method? (I don't want to know about the id at all if I'm us

Re: Bug with Foo.objects.get_or_create

2006-06-12 Thread m h
Ticket 2144 On 6/12/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > Hi mh. > I had a similar issue, and my work around was to put the category > into the defaults section (as well) > > e2, created = Foo.objects.get_or_create(name=name, category=c, > defaults={ display_name=.., category=c } ) > > b

Re: Bug with Foo.objects.get_or_create

2006-06-12 Thread Ian Holsman
hmm.. I just checked my code and I use the 'id' fields obj, created = ObjectHourUserCounter.objects.get_or_create ( content_type__id__exact = ct_id, object_id = object.id, effective_date= this_hour, user__id__exact = user_id, session_key = session, defaults={'vie

Re: Bug with Foo.objects.get_or_create

2006-06-12 Thread m h
Ian- thanks for the swift response e , created = Foo.objects.get_or_create(name=name, category=c, display_name=dname, description=desc, homepage=home, logo_name="", small_logo_name="",defaults={"category":c}) fails with the same error I'll file a bug On 6/12/06, Ian Holsman <[EMAIL PROTEC

Re: Bug with Foo.objects.get_or_create

2006-06-12 Thread Ian Holsman
Hi mh. I had a similar issue, and my work around was to put the category into the defaults section (as well) e2, created = Foo.objects.get_or_create(name=name, category=c, defaults={ display_name=.., category=c } ) but you should probably raise a bug for this. regards Ian. On 13/06/2006, a

Bug with Foo.objects.get_or_create

2006-06-12 Thread m h
FYI... I'm having an issue with the get_or_create helper method. Apparently it isn't coercing parameters properly. I've got some code that looks like this: e = Foo(name=name, category=c, display_name=name.capitalize()) e2, created = Foo.objects.get_or_create(name=name, category=c, display_nam

sql initial data files

2006-06-12 Thread [EMAIL PROTECTED]
Hi, I'm using postgresql for my django app and I want to have a trigger to be created for one of my django models I hoped that the sqlinitialdata feature would do the job for me but it failed. Problems: 1) '%' in statments (psycopg is trying to format a string) 2) multiline "create function"

wsgiref in python's stdlib

2006-06-12 Thread Bill de hÓra
Fyi, wsgiref landed in Python's subversion repo last Friday: http://mail.python.org/pipermail/python-dev/2006-June/065767.html http://svn.python.org/view/python/trunk/Lib/wsgiref/ cheers Bill --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Bug in django.db.models.base.Model.save() for emptry models?

2006-06-12 Thread Malcolm Tredinnick
Hi Michael, On Mon, 2006-06-12 at 14:33 +0200, Michael Radziej wrote: > Hi, > > I wonder if there's a bug in the case that save() creates a new record for a > model without data. [...] > The pk value isn't retrieved. There should be a: > > setattr(self, self._meta.pk.attname,

Bug in django.db.models.base.Model.save() for emptry models?

2006-06-12 Thread Michael Radziej
Hi, I wonder if there's a bug in the case that save() creates a new record for a model without data. That's what happens if there is data provided (i.e., attributes assigned) (lines 158ff) if db_values: cursor.execute("INSERT INTO %s (%s) VALUES (%s)" % \

Re: Logic error in forms/__init__.py?

2006-06-12 Thread Jeroen Ruigrok van der Werven
On 6/5/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > Nice catch. What's the proper plural-only way to handle this with gettext? In this case, since we know it can never trigger (please verify it cannot ;)) we can simply use gettext(), so: raise validators.ValidationError, gettext("Ensure your