Error creating the model class

-1

I have been with this error for many days and I do not know what it is. Can someone help me? I already try several things and do the migration again but it does not let me

    
asked by GuilleMetal 25.07.2018 в 02:52
source

1 answer

0

you must add this to the model attribute, on_delete=models.CASCADE , it should be like this: first_player = models.ForeingKey(User, related_name="games_first_player", on_delete=models.CASCADE) and with the second player also, to all the fields that are foreign keys you must put it, second_player = models.ForeingKey(User, related_name="games_second_player", on_delete=models.CASCADE)

    
answered by 11.09.2018 в 16:33