I have a Django 1.8 project, and on one of my models I use the new UUIDField, for example:
class MyModel(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
I also installed my admin.py:
@admin.register(MyModel)
class MyModelAdmin(admin.ModelAdmin):
pass
When I load the admin page to try to create an instance, I get an error message:
ValueError at /admin/core/mymodel/add/
badly formed hexadecimal UUID string
I can create an instance without problems from the Django ( ./manage.py shell) shell . However, when I did this, I get the same error as before on the admin site even when viewing a list of object instances.
Any thoughts?
source
share