Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Commit

Permalink
Merge pull request #32 from nigelbabu/version-foo-admin-improve
Browse files Browse the repository at this point in the history
Filter for admin, show product names
  • Loading branch information
davedash committed Oct 25, 2011
2 parents ba0d713 + 04e2720 commit 585c8e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/feedback/admin.py
Expand Up @@ -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']
Expand Down
5 changes: 3 additions & 2 deletions apps/feedback/models.py
Expand Up @@ -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()
Expand Down

0 comments on commit 585c8e5

Please sign in to comment.