Skip to content

Commit

Permalink
removing quantity from the ing model
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanNoelk committed Nov 20, 2018
1 parent 289d720 commit 87bf5ac
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 5 deletions.
3 changes: 2 additions & 1 deletion v1/ingredient/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class IngredientAdmin(admin.ModelAdmin):
ordering = ['title', 'ingredient_group']
list_display = ['title', 'quantity', 'measurement']
list_display = ['title', 'numerator', 'denominator', 'measurement']
list_filter = ['ingredient_group__title']
search_fields = ['title', 'ingredient_group__title', ]

Expand All @@ -18,5 +18,6 @@ class IngredientGroupAdmin(admin.ModelAdmin):
list_filter = ['recipe__title']
search_fields = ['title', 'recipe__title', ]


admin.site.register(Ingredient, IngredientAdmin)
admin.site.register(IngredientGroup, IngredientGroupAdmin)
17 changes: 17 additions & 0 deletions v1/ingredient/migrations/0012_remove_ingredient_quantity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.0.1 on 2018-11-20 00:41

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('ingredient', '0011_auto_20180415_2352'),
]

operations = [
migrations.RemoveField(
model_name='ingredient',
name='quantity',
),
]
4 changes: 0 additions & 4 deletions v1/ingredient/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ class Ingredient(models.Model):
:measurement: = Measurement of the Ingredient (EX: Liters, Cups, Grams, tablespoons)
:quantity: = Amount of the Ingredient Needed (EX: 200, 15, 2)
"""
# TODO: quantity is no longer used. (Apr. 5 2018)
# It is only here to allow for rollbacks to older version .
# It should be removed in future versions.
title = models.CharField(_('title'), max_length=250)
quantity = models.FloatField(_('quantity'), default=0)
numerator = models.FloatField(_('numerator'), default=0)
denominator = models.FloatField(_('denominator'), default=1)
measurement = models.CharField(_('measurement'), max_length=200, blank=True, null=True)
Expand Down
24 changes: 24 additions & 0 deletions v1/list/migrations/0008_auto_20181120_0041.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.0.1 on 2018-11-20 00:41

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('list', '0007_auto_20180129_1456'),
]

operations = [
migrations.RemoveField(
model_name='groceryrecipe',
name='list',
),
migrations.RemoveField(
model_name='groceryrecipe',
name='recipe',
),
migrations.DeleteModel(
name='GroceryRecipe',
),
]
17 changes: 17 additions & 0 deletions v1/menu/migrations/0008_auto_20181120_0041.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.0.1 on 2018-11-20 00:41

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('menu', '0007_auto_20180827_2124'),
]

operations = [
migrations.AlterModelOptions(
name='menuitem',
options={'ordering': ['start_date', 'id']},
),
]

0 comments on commit 87bf5ac

Please sign in to comment.