Closed ksonbol closed 9 years ago
+1
IMO a better approach would be to attempt to create an uuid.UUID instance which would raise exceptions automatically. All the checks are already present in the UUID class so there is no need to replicate these in the UUIDField. This also solves many other cases like non-hex characters in the string.
...
uuid.UUID(value) # This will raise TypeError or ValueError for bad values
return value
@rychlis Great idea! I will add this to the pull request.
Thanks all!
Fixes #46.