1 from django.db import models
2 from django.contrib.auth.models import User
6 class Ingredient(models.Model):
7 name = models.CharField(max_length=100)
8 slug = models.SlugField()
10 def __unicode__(self):
14 class Artist(models.Model):
15 name = models.CharField(max_length=150)
16 slug = models.SlugField()
17 bio = models.TextField()
19 def __unicode__(self):
23 class Sandwich(models.Model):
24 adjective = models.CharField(max_length=200)
25 slug = models.SlugField()
26 date_made = models.DateField()
27 date_added = models.DateTimeField(default=datetime.datetime.now, editable=False)
28 artist = models.ForeignKey(Artist)
29 ingredients = models.ManyToManyField(Ingredient)
30 picture = models.ImageField(upload_to='sandwiches/')
31 notes = models.TextField()
34 ordering = ['date_added']
35 verbose_name_plural = "Sandwiches"
37 def __unicode__(self):