[damned-lies] Improved admin display for Domain class



commit e5820d9bd5d841a1566cfe41b421e90193365864
Author: Claude Paroz <claude 2xlibre net>
Date:   Sat Dec 19 11:52:19 2009 +0100

    Improved admin display for Domain class

 stats/admin.py  |    3 ++-
 stats/models.py |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/stats/admin.py b/stats/admin.py
index 634d1c1..35a880d 100644
--- a/stats/admin.py
+++ b/stats/admin.py
@@ -60,7 +60,8 @@ class BranchAdmin(admin.ModelAdmin):
     search_fields = ('name', 'module__name')
 
 class DomainAdmin(admin.ModelAdmin):
-    pass
+    list_display = ('__unicode__', 'directory', 'pot_method')
+    search_fields = ('name', 'module__name','directory', 'pot_method')
 
 class CategoryInline(admin.TabularInline):
     model = Category
diff --git a/stats/models.py b/stats/models.py
index 3db1f10..658a9c6 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -626,7 +626,7 @@ class Domain(models.Model):
         ordering = ('-dtype', 'name')
 
     def __unicode__(self):
-        return "%s (%s)" % (self.name, self.get_dtype_display())
+        return "%s (%s/%s)" % (self.name, self.module.name, self.get_dtype_display())
 
     def potbase(self):
         if self.name[:2] == 'po':



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]