0
I have a problem in Python/Django
. The tables school
and school_application_info
are related. However, there is no record of any school_id
in school_application_info
. So I added null=True, blank=True
staying that way:
school = models.OneToOneField(School, related_name='school_application_info', null=True, blank=True)
Then I did the Django Migrations commands:
./manage.py makemigrations
./manage.py migrate
But it is not working and generates an error:
SchoolViewSet: ErrorResponse - status:400, resp:{'school_application_info': [u'This field may not be null.']}
which library you are using for the Rest api??
– ppalacios
I am using Django-Rest-framework.
– Lucas Henrique
Lucas, could you share the view code that gets the call?
– Rubico