Re: Database problem in Django

2014-06-19 Thread Stodge
Read the documentation: https://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by On Wednesday, 18 June 2014 08:06:18 UTC-4, Ashu Singh wrote: > > Hello everyone. My doubt is how to fetch the recent two database entries > in django. User may enter into database anytime but the query s

Re: Database problem in Django

2014-06-18 Thread C. Kirby
You really need to show the models you are interested in this working on. In particular you will need the models to have a "created time" or something similar to order your query on. Kirby On Wednesday, June 18, 2014 7:06:18 AM UTC-5, Ashu Singh wrote: > > Hello everyone. My doubt is how to fet

Re: Database problem in Django

2014-06-18 Thread Glen Jungels
Erik is certainly right on this. All queries are point in time and in databases with large numbers of inserts per second, getting the true last two inserts will be relative to when the query starts. On Jun 18, 2014 9:33 AM, "Erik Cederstrand" wrote: > Den 18/06/2014 kl. 14.31 skrev Glen Jungels

Re: Database problem in Django

2014-06-18 Thread Erik Cederstrand
Den 18/06/2014 kl. 14.31 skrev Glen Jungels : > It will be different depending on the database (assuming you are asking about > the query only). You will need to do an order by on either your auto > incremented field or dat field plus something like a limit 2 (Postgres and I > believe MySQL) o

RE: Database problem in Django

2014-06-18 Thread Glen Jungels
uot; > > > >-Original Message- > >From: django-users@googlegroups.com > >[mailto:django-users@googlegroups.com] On Behalf Of Ashu Singh > >Sent: Wednesday, June 18, 2014 4:03 PM > >To: django-users@googlegroups.com > >Subject: Database proble

RE: Database problem in Django

2014-06-18 Thread Ilya Kazakevich
.com >[mailto:django-users@googlegroups.com] On Behalf Of Ashu Singh >Sent: Wednesday, June 18, 2014 4:03 PM >To: django-users@googlegroups.com >Subject: Database problem in Django > >Hello everyone. My doubt is how to fetch the recent two database entries in >django. User may e

Database problem in Django

2014-06-18 Thread Ashu Singh
Hello everyone. My doubt is how to fetch the recent two database entries in django. User may enter into database anytime but the query should always fetch last two entries. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Database problem in Django

2014-06-18 Thread Ashu Singh
Hello everyone. My doubt is how to fetch the recent two database entries in django. User may enter into database anytime but the query should always fetch last two entries. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t