From 574ee1035dc6ba637a23a0e854b3dcc9e022c755 Mon Sep 17 00:00:00 2001 From: Kriti Godey Date: Fri, 26 Feb 2010 18:18:45 -0500 Subject: [PATCH] Removed "Artist" model and all references to it - unnecessary! --- admin.py | 6 +----- forms.py | 9 +-------- models.py | 12 ------------ urls.py | 2 +- views.py | 4 ++-- 5 files changed, 5 insertions(+), 28 deletions(-) diff --git a/admin.py b/admin.py index ad93a1a..dab4666 100644 --- a/admin.py +++ b/admin.py @@ -1,8 +1,5 @@ from django.contrib import admin -from recipes.maayanwich.models import Artist, Ingredient, Sandwich - -class ArtistAdmin(admin.ModelAdmin): - prepopulated_fields = {"slug": ("name",)} +from recipes.maayanwich.models import Ingredient, Sandwich class IngredientAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("name",)} @@ -10,6 +7,5 @@ class IngredientAdmin(admin.ModelAdmin): class SandwichAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("adjective",)} -admin.site.register(Artist, ArtistAdmin) admin.site.register(Ingredient, IngredientAdmin) admin.site.register(Sandwich, SandwichAdmin) \ No newline at end of file diff --git a/forms.py b/forms.py index 8685ea4..c5a5ae6 100644 --- a/forms.py +++ b/forms.py @@ -1,5 +1,5 @@ from django.forms import ModelForm -from models import Sandwich, Ingredient, Artist +from models import Sandwich, Ingredient class SandwichForm(ModelForm): @@ -13,11 +13,4 @@ class IngredientForm(ModelForm): class Meta: model = Ingredient - exclude = ('slug',) - - -class ArtistForm(ModelForm): - - class Meta: - model = Artist exclude = ('slug',) \ No newline at end of file diff --git a/models.py b/models.py index 6c4f4b0..abbf825 100644 --- a/models.py +++ b/models.py @@ -10,24 +10,12 @@ class Ingredient(models.Model): def __unicode__(self): return self.name - -class Artist(models.Model): - name = models.CharField(max_length=150) - slug = models.SlugField() - bio = models.TextField() - - 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) - artist = models.ForeignKey(Artist, related_name='Artist') - patron = models.ForeignKey(Artist, related_name='Patron') picture = models.ImageField(upload_to='sandwiches/') notes = models.TextField() user = models.ForeignKey(User) diff --git a/urls.py b/urls.py index c90bca8..66c17b1 100644 --- a/urls.py +++ b/urls.py @@ -3,6 +3,6 @@ import views from django.shortcuts import render_to_response urlpatterns = patterns('', - (r'^addsandwich/$', views.add_sandwich), + (r'^addsandwich/$', views.add_sandwich), (r'^addingredient/$', views.add_ingredient), ) diff --git a/views.py b/views.py index 49f1c68..bfe67a5 100644 --- a/views.py +++ b/views.py @@ -1,9 +1,9 @@ from django.http import HttpResponse -from forms import SandwichForm, IngredientForm, ArtistForm +from forms import SandwichForm, IngredientForm from django.shortcuts import render_to_response from django.core.files.uploadedfile import SimpleUploadedFile from django.template.defaultfilters import slugify -from models import Sandwich, Artist, Ingredient +from models import Sandwich, Ingredient import datetime -- 2.20.1