Django Makemigration Error Can't Serialize

785 views
Skip to first unread message

Wesley Montcho

unread,
Jan 9, 2020, 12:57:08 PM1/9/20
to Django users
Hello everyone, 
I'm a beginner in coding and i choose python,  like my favorite. 


I am interresting myself to python frameworks, and technologies, and I'm trying to have knoweldge in web develoment through django; 

But, recently i have some error of migration in my django project that i cannot fix; 

When i try to make migrations i have this error:

ValueError: Cannot serialize: <django.db.models.query_utils.DeferredAttribute object at 0x000001885B094160>
There are some values Django cannot serialize into migration files.



please i want some person to help me about this, i have somme challenge and this error make me late; 

Thanks
models.py

Caique Reinhold

unread,
Jan 9, 2020, 2:57:14 PM1/9/20
to Django users
The problem is on the on_delete=models.SET() lines.

The models.SET() option does not accept field declarations. It should be given a method or a queryset that must return an instance of the relationship model.

You can read more about how to use SET in the documentation: https://docs.djangoproject.com/en/3.0/ref/models/fields/#django.db.models.SET 
Reply all
Reply to author
Forward
0 new messages