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
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
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
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
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
.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
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
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
8 matches
Mail list logo