I agree that the current uuidfield is a simplistic solution to be used as
autofield, and having a way to specify your autofield type globally would
be good, equally something like a biginteger field. The complexity involved
with doing this (custom RETURNING statements, database level defaults,
integration with migrations) is an order of magnitude more complex than the
solution committed. I knew that was the intention of the original issue but
it was also why it hadn't been solved for the "simple" case.

I did spend some time looking at the more complete solution and honestly
could not work out how to approach it. I found if hit many more parts of
the internals of the ORM than I expected.
On 18 Dec 2015 12:32 a.m., "Curtis Maloney" <[email protected]> wrote:

> I've identified one new "issue".
>> There is an implicit assumption that primary keys are useful for
>> ordering by the current QuerySet API methods `.first()` and `.last()`.
>>
>
> I believe the case here is that first and last are meaningless without an
> ordering, so in lieu of any programmer supplied ordering, a "fallback"
> consistent ordering of 'pk' is used.
>
> Remember the DBMS is under no obligation to return a query in consistent
> order without an ORDER BY clause.
>
> So, without an ordering, two successive calls to first() [or last()] may,
> in fact, return different records even without modifications to the table.
>
> It's not expected people should _rely_ on the ordering of PK, and, indeed,
> it's frequently recommended against inferring any meaning from PK values
> [sqlite, IIRC, assigns them pseudo-ramdomly]
>
> That said, the assumption that a PK is sortable and will provide a
> deterministic ordering shouldn't be much to ask, surely?
>
> --
> Curtis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers  (Contributions to Django itself)" 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 https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/567353FA.6030105%40tinbrain.net
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMwjO1Eq%3DHT6udKuFtap%3Dpos0ebkoNwvROuzYLH3fk%3Dr0gdj%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to