Permalink
Browse files

Merge pull request #32 from nigelbabu/version-foo-admin-improve

Filter for admin, show product names
  • Loading branch information...
2 parents ba0d713 + 04e2720 commit 585c8e52e38122f65814e3ee21b083cb2ef592cc @davedash davedash committed Oct 25, 2011
Showing with 4 additions and 2 deletions.
  1. +1 −0 apps/feedback/admin.py
  2. +3 −2 apps/feedback/models.py
View
@@ -44,6 +44,7 @@ class TermAdmin(admin.ModelAdmin):
class VersionCountAdmin(admin.ModelAdmin):
list_display = ('product', 'version', 'num_opinions', 'active')
+ list_filter = ('active', 'product')
ordering = ('-version', 'product')
readonly_fields = ('product', 'version', 'num_opinions', 'version_int')
search_fields = ['version']
View
@@ -217,11 +217,12 @@ class Meta:
class VersionCount(ModelBase):
"""Denormalized model built from product info and opinion counts.
-
+
Built from products, versions, number of opinions, and active status.
"""
- product = models.PositiveSmallIntegerField(db_index=True)
+ product = models.PositiveSmallIntegerField(db_index=True,
+ choices=((prod, PRODUCT_IDS[prod].pretty) for prod in PRODUCT_IDS))
version = models.CharField(max_length=30, db_index=True)
version_int = models.BigIntegerField(db_index=True)
num_opinions = models.IntegerField()

0 comments on commit 585c8e5

Please sign in to comment.