How do I use the UUIDField in my model?
If i do
somefield = UUIDField
i get:
UUIDField is not defined.
I do import uuid on top of my models file.
And i have django_extensions in installed apps…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A good place to see how to use features of a Django app is in the app’s tests.
Here are some example models from django-extension’s UUIDField tests that demonstrate how to use the field:
Without seeing the whole file, it’s hard to tell what’s going on. Make sure you import
UUIDFieldfromdjango_extensions.db.fields(like in the above example) and not Python’suuidmodule.