Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Add a few fields to make the admin a bit more useful.
Browse files Browse the repository at this point in the history
  • Loading branch information
willbarton committed Feb 26, 2015
1 parent 2bdcbd0 commit 4606ba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions porchlightapi/admin.py
Expand Up @@ -15,8 +15,11 @@ class RepositoryAdmin(admin.ModelAdmin):
class ValueDataPointAdmin(admin.ModelAdmin):
# All the fields are readonly
list_display = ('created',
'repository',
'undeployed_datetime',
'undeployed_identifier',
'deployed_datetime',
'deployed_identifier',
'value')
readonly_fields = ('repository',
'created',
Expand All @@ -27,6 +30,7 @@ class ValueDataPointAdmin(admin.ModelAdmin):
'deployed_datetime',
'deployed_value',
'value',)
list_filter = ('repository',)

# We don't allow admin to add or change data points. Only view.
def has_add_permission(self, request):
Expand Down
3 changes: 3 additions & 0 deletions porchlightapi/models.py
Expand Up @@ -51,6 +51,9 @@ class Meta:
max_length=200,
help_text='This is a Python callable, defined in settings.py, that calculates the total unshipped value for this repository.')

def __unicode__(self):
return self.name

def deployed_value(self):
"""
Get and run the deployed_value_source.
Expand Down

0 comments on commit 4606ba5

Please sign in to comment.