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

TypeError: can't adapt type '_FakeSqlVal' #158

Open
jordanvs opened this issue Jul 18, 2024 · 1 comment
Open

TypeError: can't adapt type '_FakeSqlVal' #158

jordanvs opened this issue Jul 18, 2024 · 1 comment

Comments

@jordanvs
Copy link

I'm on Django 3.2 / Postgres. When I go to save a model in Django Admin that is using a Multiselect field (note the model is also polymorphic using django-polymorphic), this error occurs. I can't trace it back to anything. Haven't been able to look through the library code yet.

This occured for me on the latest bump to 0.1.13 version. For now I have to downgrade back to 0.1.12 which solves the issue.

@isacmms
Copy link

isacmms commented Sep 11, 2024

This started happening with me recently. pip-compile updated from version 0.1.12 to 0.1.13.

I have a model A which is a configuration to generate new records of model B. The model A is created and have no problems saving this multiselectfield. There is another routine that copies this field from model A on a new instance of model B and when saving B is when the error occurs.

If model clean field is running it throws TypeError: '>' not supported between instances of 'int' and 'NoneType' when running MaxValueValidator or MaxLengthValidator. If not, it throws TypeError: can't adapt type '_FakeSqlVal'.
The column on database of model B is correct, but the model field has all choices loaded as None on application and end up passing a list of None to model A causing these problems on save.

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

2 participants