Restructure cookbook directories and use Grappelli for the admin interface.
[cookbook.git] / cookbook / admin.py
index fa29c02d4f4cbc75f797337eefd9c533bab6ec33..4515bd831155064ff70e409bfda0f2e8f4baf958 100644 (file)
@@ -2,14 +2,14 @@ from django import forms
 from django.contrib import admin
 from django.db import models as django_models
 
-import models
+from . import models
 
 
 class IngredientInline (admin.TabularInline):
     model = models.Ingredient
+    sortable_field_name = 'position'
     extra = 0
 
-
 class IngredientBlockAdmin (admin.ModelAdmin):
     fieldsets = [
         (None, {'fields': ['name']}),
@@ -25,10 +25,10 @@ class IngredientBlockAdmin (admin.ModelAdmin):
 class IngredientBlockInline (admin.TabularInline):
     model = models.IngredientBlock
     fieldsets = [
-        (None, {'fields': ['name']}),
+        (None, {'fields': ['name', 'position']}),
         ]
+    sortable_field_name = 'position'
     inlines = [IngredientInline]
-
     list_display = ['name']
     extra = 0
     show_edit_link = True  # https://code.djangoproject.com/ticket/13163