Friday, February 23, 2018

Re: UUIDs eventually choke as primary key

The thing that gets me is this part:

.../django/db/models/fields/__init__.py in to_python
                return uuid.UUID(value) ...
/usr/local/lib/python3.6/uuid.py in __init__
            hex = hex.replace('urn:', '').replace('uuid:', '') ...

During handling of the above exception ('UUID' object has no attribute 'replace'), another exception occurred:

If you dig into the code, it looks like (based on the exception) a UUID is being passed into the UUID constructor. But the lines before that constructor call happens check to see if it's a UUID. I'm wondering if I'm somehow getting two different UUID classes. I have noticed in the python path that there are two paths to .../lib/python3.6. One from my virtualenv, and one at /usr/local/.  Not sure where to clear that up, since I don't believe I've got my apache env set up to pull from both places.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d34e8538-dede-4540-843f-6c30255be951%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment