django_builder icon indicating copy to clipboard operation
django_builder copied to clipboard

ForeignKeys need Class name.

Open RichardBH opened this issue 7 years ago • 3 comments

Hi, thank you for this great work. I use it a lot. I would like to request that when a foreignkey relationship is created that the code includes the class Name.

For Example: (See below) location = models.ForeignKey(on_delete=models.CASCADE) should be location = models.ForeignKey(Location, on_delete=models.CASCADE)

class location(models.Model):
    # Fields
    name = models.CharField(max_length=255)
    ...

class item(models.Model):
    # Fields
    name = models.CharField(max_length=255)
...
    # Relationship Fields
    location = models.ForeignKey(<NEED TO ADD Location HERE>, on_delete=models.CASCADE)
...

RichardBH avatar Jul 29 '18 23:07 RichardBH

Hi Thanks for this, i will take a look.

mmcardle avatar Jul 31 '18 17:07 mmcardle

Also they are lost on the Models.py import / upload.

awinner1 avatar Oct 11 '18 15:10 awinner1

Ok should be fixed for Models in the app

mmcardle avatar Oct 12 '18 14:10 mmcardle