Re: django queryset based on when data created
You can use ordering by primary key (id by default) because it increments by every insert. So newly created rows in db will have greater id than others. In most cases it can be enough. --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django queryset based on when data created
On Wed, 2009-08-05 at 21:41 -0700, Joru wrote: > Everytime I edit some data, the data order in queryset changed into > the newest edited > Is it posible to get queryset that ordered based when the data created > without having to add creation date for sorting purpose The order results are returned in SQL when you don't supply explicit ordering is completely undefined. It can even change without the data changing (if the database tables are vacuumed to better utilise space, for example). Unless you specify an ordering, there are no guarantees in this area. Regards, Malcolm --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
django queryset based on when data created
Everytime I edit some data, the data order in queryset changed into the newest edited Is it posible to get queryset that ordered based when the data created without having to add creation date for sorting purpose --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---