Re: Probable Bug, foreign key to a database view.

2022-04-05 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Sandeep - it's best to report bugs as tickets. Anyway, I checked this out for you and I don't see the problem. I started a project, and added the code you suggested as models, ran makemigrations, and saw this error: $ ./manage.py makemigrations core SystemCheckError: System check identified some

Re: Probable Bug, foreign key to a database view.

2022-04-03 Thread Alexandru M.
Does it behave the way you're expecting it to behave if you declare field as models.CharField(max_length=4, primary_key=True)? On Saturday, 26 March 2022 at 15:45:39 UTC+2 sandeep...@gmail.com wrote: > class View(models.Model): > field = models.CharField(max_length=4) > class Meta: >

Probable Bug, foreign key to a database view.

2022-03-26 Thread Sandeep Harlalka
class View(models.Model): field = models.CharField(max_length=4) class Meta: managed=False db_table = 'view' #database view class Child(models.Model): view = models.ForeignKey(View, on_delete=models.CASCADE, to_field='field', db_constraint=False) makemigrations on