Refer to issue https://code.djangoproject.com/ticket/27595

This problem is broader than admin. It arises because if the scenario 
described in the ticket is used (UUID foreign keys on Sqlite3), then what 
is stored in myforeignkey_id is a string containing a uuid value without 
any dashes, i.e. a hex value, while what is being stored in the related 
object instance is a value of type UUID.

The comparison in the select widget fails, so it does not have any option 
selected because the comparison fails.

I am not an sqlite3 expert - I presume that sqlite3 is storing UUID values 
as hex values given the string representation. Postgresql stores them 
differently. 

For these models.ForeignKey that relate to primary keys that are 
models.UUIDFields, should the python representation of x_id be a UUID type, 
so that it is equal to the x.id value. If a developer uses integers as 
their primary keys, then these values do have equality, but because of the 
use of UUIDs as primary keys they do not.

Thoughts.....

-- 
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/38c0ae18-0b3f-430e-9b36-1e1004289286%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to