Open rpf13 opened 1 year ago
I had to step back from the idea of having multiple images per item, since this has increased the level of complexity for the whole project quite a lot. Since I have to deliver MVP, I will let this feature for future implementation. I had to adapt the db model to reflect this. Here the original models.py file, which will be used once this feature will be implemented....creating a Image class:
# Class to create a new item in a collection
class Item(models.Model):
item_id = models.AutoField(primary_key=True)
item_name = models.CharField(max_length=100)
collection_id = models.ForeignKey(Collection, on_delete=models.CASCADE)
reference = models.CharField(max_length=100)
description = models.CharField(max_length=200)
details = models.TextField()
added_on = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ["-added_on"]
def __str__(self):
return self.item_name
# Class to add image to an item
class Image(models.Model):
image_id = models.AutoField(primary_key=True)
item_id = models.ForeignKey(Item, on_delete=models.CASCADE)
image = CloudinaryField('image', default='placeholder')
As a Developer I can define future features and improvements so that the app has the option to grow and getting better
Potential User Stories