0

I want to use an existing database but after inspectdb generates an auto generated models file the relations of the models are not according to django.

For example:

user_id = models.IntegerField(blank=True, null=True)

which should be a foreign key:

user_id = models.Foreignkey('User',on_delete=models.CASCADE)
tread
  • 10,133
  • 17
  • 95
  • 170

0 Answers0