Re: How to find out id of the first record?

2006-03-08 Thread PythonistL
Thank you all for help L. --~--~-~--~~~---~--~~ 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@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Re: How to find out id of the first record?

2006-03-08 Thread Andy Shaw
Andy Shaw wrote: > lowest ID, or you can write a custom SQL query to do the same thing. I > don't know if Django currently has a built-in feature to let you do > this, though it is possible that the database will return the records in Julio Nobrega wrote: > first_record = models.get_list(order_by

Re: How to find out id of the first record?

2006-03-08 Thread Laurent RAHUEL
Le Mercredi 8 Mars 2006 14:26, Andy Shaw a écrit : > PythonistL wrote: > > Hi, > > is there a way how to find out id of the first record in a table? > > I will explain what I mean. > > When I insert the first record into a table the id is 1. > > when I insert ne

Re: How to find out id of the first record?

2006-03-08 Thread Julio Nobrega
Something like this perhaps... first_record = models.get_list(order_by = ['id'], limit = 1)[0] Maybe even .get_object() if it works with limit 1. On 3/8/06, Andy Shaw <[EMAIL PROTECTED]> wrote: > > As the ID field is auto-incremented, the earliest ('first') record will > be the one with t

Re: How to find out id of the first record?

2006-03-08 Thread Andy Shaw
PythonistL wrote: > Hi, > is there a way how to find out id of the first record in a table? > I will explain what I mean. > When I insert the first record into a table the id is 1. > when I insert next record, the id for this record will be 2. > But if I delete the first rec

How to find out id of the first record?

2006-03-08 Thread PythonistL
Hi, is there a way how to find out id of the first record in a table? I will explain what I mean. When I insert the first record into a table the id is 1. when I insert next record, the id for this record will be 2. But if I delete the first record, the id of the first record will be 2 .So, I