On 27 févr. 2013, at 23:34, Wim Feijen <[email protected]> wrote: > Therefore, my proposal is, if we are going to implement the earliest and > latest method, we should definitely rename them to: first and latest.
I believe that latest() was introduced with dates in mind, and then earliest() for consistency with latest(). Note that models also have a "get_latest_by" meta attribute defining the order if none is specified. You're absolutely right: this feature is useful for any field with a meaningful order, and latest / earliest aren't an intuitive API. I would support renaming them to first / last through a deprecation path. The new aliases would be available immediately, the old ones would be removed in two versions. And while we're there, I suggest to rely on the existing "ordering" meta attribute and to remove "get_latest_by". I suspect that in many cases these two attributes have the same value, and you can specify an explicit ordering otherwise. -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
