dcramer / django-uuidfield

A UUIDField for Django
BSD 3-Clause "New" or "Revised" License
262 stars 115 forks source link

ValueError: badly formed hexadecimal UUID string #36

Closed pazooki closed 9 years ago

pazooki commented 10 years ago

I don't know why it's failing with this error. the way I am using it looks legit to me. https://gist.github.com/pazooki/b3ee2937c72bd0fa679f#file-traceback

SteveAyre commented 10 years ago

This appears to be caused by the hyphenate option. This creates 36-character strings, while the length of the field is fixed at 32. Data gets truncated on insert, and is thus incomplete when read.

SteveAyre commented 10 years ago

I experienced the same error when creating the database with syncdb, inserting a record with a hyphenated uuid (using either models or UUID() in sql) and then running dumpdata.

After recreating the database table after the above modification the field is of the correct size, data is no longer truncated, and the error no longer occurs.

jleclanche commented 9 years ago

This is the same as #40