Closed akramhussein closed 4 years ago
Hi @akramhussein thanks for reaching out. You are correct that is an issue in python-measurement
. Django requires values in migrations to be "serializable", which means they need to implement a method called deconstruct
as well as __eq__
.
I would very much welcome a fix for that, would you be up to create a pull-request over here https://github.com/coddingtonbear/django-measurement and add the deconstruct
method?
Best -Joe
Hi @codingjoe - happy to tackle this PR. Can't do it immediately, but will hopefully end of this week, start of next.
@akramhussein sure, just ping me, when you are done
Not sure what's the status here. But it still doesn't work out of the box. But there is an easy fix
@deconstructible
class Distance(measures.Distance):
pass
@deconstructible
class Weight(measures.Weight):
pass
@rajnishdahiya good point. I will try to fix that in the next version.
When I use the code examples from the unit tests that use
MinValueValidator
andMaxValueValidator
, such as:From here.
Upon creating the migration I receive the error:
Using Django version
2.1.7