Re: Basic database API questions

2008-06-14 Thread Russell Keith-Magee
On Sat, Jun 14, 2008 at 8:26 PM, LB <[EMAIL PROTECTED]> wrote: > > Thanks for the fast replies ! No problems. > So I think I only have three options now : > > 1) change my model and replace the naissance field with three fields > corresponding to birth day, birth month and birth year. This is

Re: Basic database API questions

2008-06-14 Thread LB
Thanks for the fast replies ! > So - what you were trying to do was combine the `month` and `gt` > operators - you can't do that. Django interpreted your query as 'join > the Contact with the naissance table, and check that the month > attribute is greater than 5'. Obviously, this doens't work be

Re: Basic database API questions

2008-06-14 Thread Russell Keith-Magee
On Sat, Jun 14, 2008 at 7:36 PM, LB <[EMAIL PROTECTED]> wrote: > > Thanks, > > Another question : > > why does > anniv = Contact.objects.filter(naissance__month=5) > works > > and > anniv = Contact.objects.filter(naissance__month__gt=5) > raise this exception : > : Join on field 'naissance' > not

Re: Basic database API questions

2008-06-14 Thread LB
Thanks, Another question : why does anniv = Contact.objects.filter(naissance__month=5) works and anniv = Contact.objects.filter(naissance__month__gt=5) raise this exception : : Join on field 'naissance' not permitted. --~--~-~--~~~---~--~~ You received this mess

Re: Basic database API questions

2008-06-14 Thread Russell Keith-Magee
On Sat, Jun 14, 2008 at 6:56 PM, LB <[EMAIL PROTECTED]> wrote: > > 1 ) how to get all contacts with a known birthday ? I tried : > > m = Contact.objects.filter(naissance__is_null=False) > but I got the following exception : > : Join on field 'naissance' > not permitted. You are close - but with

Basic database API questions

2008-06-14 Thread LB
Hi, I'm new to django and also new to databases. I'm trying to make a simple contact editor. So I created the following model : class Contact(models.Model): nom_famille = models.CharField("nom de famille", max_length=30) # french for last name prenom = models.CharField("prénom",