diff options
author | luxagraf <sng@luxagraf.net> | 2019-10-07 09:00:23 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-10-07 09:00:23 -0400 |
commit | 9cdfb6ec377fa534c1203c1af46662c2a1ff6f61 (patch) | |
tree | c769cf88905d232c689bcd76b8e45fc3ec0e072c | |
parent | bf095131fa91a58e667e7244940ec534e6206ae9 (diff) |
added Luxtag admin and fixed category strings
-rw-r--r-- | app/taxonomy/admin.py | 28 | ||||
-rw-r--r-- | app/taxonomy/models.py | 4 |
2 files changed, 31 insertions, 1 deletions
diff --git a/app/taxonomy/admin.py b/app/taxonomy/admin.py index cc48fac..783584e 100644 --- a/app/taxonomy/admin.py +++ b/app/taxonomy/admin.py @@ -1,5 +1,5 @@ from django.contrib import admin -from .models import Category +from .models import Category, LuxTag @admin.register(Category) @@ -26,3 +26,29 @@ class CategoryAdmin(admin.ModelAdmin): class Media: js = ('image-loader.js', 'next-prev-links.js') + + +@admin.register(LuxTag) +class LuxTagAdmin(admin.ModelAdmin): + list_display = ( + 'name', + 'color_rgb', + ) + fieldsets = ( + ('Item', { + 'fields': ( + 'name', + 'color_rgb', + 'slug', + ), + 'classes': ( + 'show', + 'extrapretty', + 'wide' + ) + } + ), + ) + + class Media: + js = ('image-loader.js', 'next-prev-links.js') diff --git a/app/taxonomy/models.py b/app/taxonomy/models.py index 38f1bf7..18d7ae3 100644 --- a/app/taxonomy/models.py +++ b/app/taxonomy/models.py @@ -34,6 +34,10 @@ class Category(models.Model): def __str__(self): return self.name + + class Meta: + verbose_name = _("Category") + verbose_name_plural = _("Categories") def get_absolute_url(self): return reverse("taxonomy:categories", kwargs={"slug": self.slug}) |