Advertisement
izznogooood

Untitled

Jul 4th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. class Picture(models.Model)
  2.     pic = models.ImageField(upload_to='/somewhere')
  3.  
  4. class Collection(models.Model):
  5.     pics = models.ManyToManyField(Picture)
  6.  
  7. class Consumer(models.Model)
  8.     xxx
  9.     pictures = models.OneToOneField(Collection, on_delete=models.CASCADE)
  10.     xxx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement