damned-lies r1096 - in branches/djamnedlies: . stats



Author: claudep
Date: Fri Oct 24 22:08:37 2008
New Revision: 1096
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1096&view=rev

Log:
2008-10-25  Claude Paroz  <claude 2xlibre net>

	* stats/admin.py: Added more objects to admin interface.
	* stats/models.py: Added more __unicode__ functions and ordering table
	attribute for better display in admin mode.

Modified:
   branches/djamnedlies/ChangeLog
   branches/djamnedlies/stats/admin.py
   branches/djamnedlies/stats/models.py

Modified: branches/djamnedlies/stats/admin.py
==============================================================================
--- branches/djamnedlies/stats/admin.py	(original)
+++ branches/djamnedlies/stats/admin.py	Fri Oct 24 22:08:37 2008
@@ -18,8 +18,16 @@
 # along with Damned Lies; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-from djamnedlies.stats.models import Statistics
+from djamnedlies.stats.models import Statistics, Module, Branch, Category, Release, Language, Team
 from django.contrib import admin
 
-admin.site.register(Statistics)
+class ReleaseAdmin(admin.ModelAdmin):
+    list_display = ('name', 'status', 'stringfrozen')
 
+admin.site.register(Statistics)
+admin.site.register(Module)
+admin.site.register(Branch)
+admin.site.register(Category)
+admin.site.register(Release, ReleaseAdmin)
+admin.site.register(Language)
+admin.site.register(Team)

Modified: branches/djamnedlies/stats/models.py
==============================================================================
--- branches/djamnedlies/stats/models.py	(original)
+++ branches/djamnedlies/stats/models.py	Fri Oct 24 22:08:37 2008
@@ -66,6 +66,7 @@
 
     class Meta:
         db_table = 'team'
+        ordering = ('description',)
 
     def __unicode__(self):
         return self.description
@@ -77,7 +78,11 @@
     team = models.ForeignKey('Team', null=True)
     class Meta:
         db_table = 'language'
-    
+        ordering = ('name',)
+
+    def __unicode__(self):
+        return "%s (%s)" % (self.name, self.locale)
+
     def bugs_url_enter(self):
         return "http://bugzilla.gnome.org/enter_bug.cgi?product=l10n&amp;component=%s%%20[%s]"; %  (self.name, self.locale)
         
@@ -117,6 +122,10 @@
 
     class Meta:
         db_table = 'module'
+        ordering = ('name',)
+    
+    def __unicode__(self):
+        return self.name
     
     def get_bugs_i18n_url(self):
         if self.bugs_base.find("bugzilla") != -1 or self.bugs_base.find("freedesktop") != -1:
@@ -493,6 +502,10 @@
 
     class Meta:
         db_table = 'release'
+        ordering = ('status', '-name')
+
+    def __unicode__(self):
+        return self.name
     
     def total_strings(self):
         """ Returns the total number of strings in the release as a tuple (doc_total, ui_total) """
@@ -684,7 +697,11 @@
 
     class Meta:
         db_table = 'category'
-        
+        ordering = ('release',)
+
+    def __unicode__(self):
+        return "%s (%s)" % (self.description, self.release)
+
 
 class Statistics(models.Model):
     # After migration, module, domain, type, branch, language can be deleted



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