Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

admin.py 435B

1234567891011121314151617181920
  1. from __future__ import unicode_literals
  2. from django.contrib import admin
  3. from taggit.models import Tag, TaggedItem
  4. class TaggedItemInline(admin.StackedInline):
  5. model = TaggedItem
  6. class TagAdmin(admin.ModelAdmin):
  7. inlines = [TaggedItemInline]
  8. list_display = ["name", "slug"]
  9. ordering = ["name", "slug"]
  10. search_fields = ["name"]
  11. prepopulated_fields = {"slug": ["name"]}
  12. admin.site.register(Tag, TagAdmin)