Skip to content

Commit 2f5cc80

Browse files
committed
Additional edits for admin interface and tagging.
1 parent ac34569 commit 2f5cc80

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
from django.contrib import admin
2+
from .models import CustomTag, TaggedItems
23

3-
# Register your models here.
4+
5+
6+
class TaggedItemInline(admin.StackedInline):
7+
model = TaggedItems
8+
9+
10+
@admin.register(CustomTag)
11+
class TagsAdmin(admin.ModelAdmin):
12+
inlines = [TaggedItemInline]
13+
list_display = ["guid", "name", "slug"]
14+
ordering = ["name", "slug", "guid"]
15+
search_fields = ["name"]
16+
prepopulated_fields = {"slug": ["name"]}

cbv3_django_prototype/cbv3_django_prototype/tagging/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,3 @@ class TaggedItems(GenericTaggedItemBase, TaggedItemBase):
3232
on_delete=models.CASCADE,
3333
related_name="%(app_label)s_%(class)s_items",
3434
)
35-
36-
#class Meta:
37-
# db_table = "tagging_tagged_item"
38-
# app_label = "taggit"

0 commit comments

Comments
 (0)