add images to the Picture model

In addition to the image attribute I added the directory where the
images get stored.
This commit is contained in:
Andreas Zweili 2017-12-06 20:32:49 +01:00
parent bba1bde937
commit 71438ed14c
2 changed files with 1 additions and 0 deletions

View File

View File

@ -77,6 +77,7 @@ class OrderOfGoods(models.Model):
class Picture(models.Model):
name = models.CharField(max_length=200, unique=True)
article = models.ForeignKey(Article, on_delete=models.CASCADE)
image = models.ImageField(upload_to="images")
def __str__(self):
return self.name