Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError when running migration with default value #28

Open
sevdog opened this issue Aug 22, 2022 · 0 comments
Open

ValueError when running migration with default value #28

sevdog opened this issue Aug 22, 2022 · 0 comments

Comments

@sevdog
Copy link

sevdog commented Aug 22, 2022

When running the makemigrations command if a relativedelta object was provided as default value an error is raised:

File "/opt/venv/lib/python3.9/site-packages/django/db/migrations/serializer.py", line 353, in serializer_factory
    raise ValueError(
ValueError: Cannot serialize: relativedelta(days=+1)
There are some values Django cannot serialize into migration files.
For more, see https://docs.djangoproject.com/en/3.2/topics/migrations/#migration-serializing

It would be useful if this app implements a custom serializer to be used in migrations for relative delta objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant