Skip to content

Instantly share code, notes, and snippets.

@KabakiAntony
Last active February 7, 2023 02:22
Show Gist options
  • Select an option

  • Save KabakiAntony/6f08d0abe1920683ca70e337eeb76a28 to your computer and use it in GitHub Desktop.

Select an option

Save KabakiAntony/6f08d0abe1920683ca70e337eeb76a28 to your computer and use it in GitHub Desktop.
image model
class Image(models.Model):
product_entry = models.ForeignKey(Product_Entry, on_delete=models.CASCADE)
thumb = models.ImageField(default='default.jpeg', blank=True)
def __str__(self):
return self.product_entry.title
class Meta:
verbose_name_plural = "Images"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment