insert_or_replace()

2006-06-05 Thread Adrian Holovaty
On 6/6/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > any chance of getting a insert_or_replace function as well? > > to do something similar to mysql 5's > > INSERT INTO table (a,b,c) VALUES (1,2,3) > ON DUPLICATE KEY UPDATE c=c+1; > > http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.ht

Re: PROPOSAL: Manager.get_or_create()

2006-06-05 Thread Ian Holsman
It sounds great.any chance of getting a insert_or_replace function as well?to do something similar to mysql 5's INSERT INTO table (a,b,c) VALUES (1,2,3)  ON DUPLICATE KEY UPDATE c=c+1;http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html(which is the other common pattern I'm seeing in my

PROPOSAL: Manager.get_or_create()

2006-06-05 Thread Adrian Holovaty
Time and time again I have the following Django code: try: obj = Person.objects.get(first_name='John', last_name='Lennon') except Person.DoesNotExist: obj = Person(first_name='John', last_name='Lennon', birthday=date(1940, 10, 9)) obj.save() This pattern gets quit

Re: Site object to contain the protocol? (https..)

2006-06-05 Thread gabor
Adrian Holovaty wrote: > On 6/5/06, gabor <[EMAIL PROTECTED]> wrote: >> i'm building a https site, and have many times problems with the Site >> objects, which kind-of assume that the site is http. >> >> would it be a good idea for the site objects to also contain the >> protocol (http or https)?

Re: Site object to contain the protocol? (https..)

2006-06-05 Thread Adrian Holovaty
On 6/5/06, gabor <[EMAIL PROTECTED]> wrote: > i'm building a https site, and have many times problems with the Site > objects, which kind-of assume that the site is http. > > would it be a good idea for the site objects to also contain the > protocol (http or https)? what do you think? I don't th

Site object to contain the protocol? (https..)

2006-06-05 Thread gabor
hi, i'm building a https site, and have many times problems with the Site objects, which kind-of assume that the site is http. would it be a good idea for the site objects to also contain the protocol (http or https)? what do you think? p.s: yes, i already mentioned it in my previous post (

Re: Logic error in forms/__init__.py?

2006-06-05 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? I need to dig into that to be honest. I will have to get back on this one, unless someone beats me to it. -- Jeroen Ruigrok van der Werven --~--~-~--~~

Re: Logic error in forms/__init__.py?

2006-06-05 Thread Adrian Holovaty
On 5/26/06, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: > Why on earth does it have: > > raise validators.ValidationError, ngettext("Ensure your text is less > than %s character.", > "Ensure your text is less than %s characters.", self.maxlength) % > self.maxlength > > Given how the

Re: Question about manipulators with foreign keys

2006-06-05 Thread Tim Keating
Not at all -- it sounds like the answer is one of the ones I expected, which was "Write a custom manipulator" Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group

Re: Must app names in django be unique?

2006-06-05 Thread Adrian Holovaty
On 6/5/06, Luke Plant <[EMAIL PROTECTED]> wrote: > Steven Armstrong wrote: > > Just found this [1], so sorry for the noise. I searched through the > > tickets, but forgot to check the mailing list archives. > > Don't worry, it's probably a good reminder, since we never actually did > anything abou

Re: Must app names in django be unique?

2006-06-05 Thread Luke Plant
Steven Armstrong wrote: > Just found this [1], so sorry for the noise. I searched through the > tickets, but forgot to check the mailing list archives. Don't worry, it's probably a good reminder, since we never actually did anything about this as far as I remember. Luke --~--~-~--~--

Re: Unit Tests for Filters

2006-06-05 Thread Luke Plant
John Sutherland wrote: > Is there some registration process I'm missing for the > filters? Yep. See: http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-filters and the bottom of: http://code.djangoproject.com/browser/django/trunk/django/template/defaultfilter