Re: newb: Django ORM for Custom SQL

2007-03-15 Thread Atilla
> I need to retrieve latest record (each record has a time stamp, > created_at), only one record, from sale table where product_id=1. How > do I do this in Django ORM? I have looked at .objects.extra{}, but I > am getting ProgrammingError 1064. > > I need to get this sql into Django ORM: > > sel

Re: newb: Django ORM for Custom SQL

2007-03-15 Thread Bram - Smartelectronix
johnny wrote: > I need to retrieve latest record (each record has a time stamp, > created_at), only one record, from sale table where product_id=1. How > do I do this in Django ORM? I have looked at .objects.extra{}, but I > am getting ProgrammingError 1064. > > I need to get this sql into Djan

Re: newb: Django ORM for Custom SQL

2007-03-15 Thread James Bennett
On 3/15/07, johnny <[EMAIL PROTECTED]> wrote: > I need to retrieve latest record (each record has a time stamp, > created_at), only one record, from sale table where product_id=1. How > do I do this in Django ORM? I have looked at .objects.extra{}, but I > am getting ProgrammingError 1064. OK,

newb: Django ORM for Custom SQL

2007-03-15 Thread johnny
I need to retrieve latest record (each record has a time stamp, created_at), only one record, from sale table where product_id=1. How do I do this in Django ORM? I have looked at .objects.extra{}, but I am getting ProgrammingError 1064. I need to get this sql into Django ORM: select created_at