Removed "Artist" model and all references to it - unnecessary!
[~kgodey/maayanwich.git] / models.py
index 71a8362..abbf825 100644 (file)
--- a/models.py
+++ b/models.py
@@ -1,3 +1,28 @@
 from django.db import models
+from django.contrib.auth.models import User
+import datetime
 
-# Create your models here.
+
+class Ingredient(models.Model):
+       name = models.CharField(max_length=100)
+       slug = models.SlugField()
+       
+       def __unicode__(self):
+               return self.name
+
+class Sandwich(models.Model):
+       adjective = models.CharField(max_length=200)
+       slug = models.SlugField()
+       date_made = models.DateField()
+       ingredients = models.ManyToManyField(Ingredient)
+       date_added = models.DateTimeField(default=datetime.datetime.now, editable=False)
+       picture = models.ImageField(upload_to='sandwiches/')
+       notes = models.TextField()
+       user = models.ForeignKey(User)
+       
+       class Meta:
+               ordering = ['date_added']
+               verbose_name_plural = "Sandwiches"
+               
+       def __unicode__(self):
+               return self.adjective