Guest User

Untitled

a guest
Apr 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. Business Data 1
  2. ---Product A
  3. ---Product B
  4. Business Data 2
  5. ---Product A
  6.  
  7. Business 1: Joe's Plumbing, located at ... ... ...
  8. ---Product A, standard ad appearing in category 3, with text "awesome plumbing"
  9. ---Product B, cooler ad appearing in category 9, with text "cheap plumbing"
  10. Business 2: Joe's Burgers, located at ... ... ...
  11. ---Product A, standard ad appearing in category 4, with text "zzz"
  12.  
  13. class Business(models.Model):
  14. name = models.CharField(max_length=255)
  15. address = models.MagicAddressField()
  16.  
  17. class Ad(models.Model):
  18. category = models.ForeignKey(Category)
  19. text = models.CharField(max_length=255)
  20. business = models.ForeignKey(Business)
  21.  
  22. class Ad(Product):
  23. objects = ProductManager()
  24.  
  25. category = models.ForeignKey(Category)
  26. text = models.CharField(max_length=255)
  27. business = models.ForeignKey(Business)
Add Comment
Please, Sign In to add comment