Commits

Stephen McDonald  committed 52bacd7 Draft

Nicer link admin

  • Participants
  • Parent commits a150222

Comments (0)

Files changed (2)

File main/admin.py

 from .models import Link
 
 
-admin.site.register(Link, DisplayableAdmin)
+class LinkAdmin(DisplayableAdmin):
+    list_display = ("id", "title", "status", "publish_date",
+                    "user", "comments_count", "rating_sum")
+    list_display_links = ("id",)
+    list_editable = ("title", "status")
+    list_filter = ("status", "user__username")
+    ordering = ("-publish_date",)
+
+
+admin.site.register(Link, LinkAdmin)

File main/templates/admin/main/link/change_list.html

+{% extends "admin/change_list.html" %}
+{% block extrahead %}
+{{ block.super }}
+<style>.vTextField {width:400px !important;}</style>
+{% endblock %}