Merge branch 'useful_admin' into improve_admin

Conflicts:
	admin.py
pull/1/head
Andromeda Yelton 2013-05-06 15:53:49 -04:00
commit ca71b5b4de
1 changed files with 8 additions and 2 deletions

View File

@ -22,7 +22,8 @@ class RegluitAdmin(AdminSite):
login_template = 'registration/login.html' login_template = 'registration/login.html'
class UserAdmin(ModelAdmin): class UserAdmin(ModelAdmin):
pass search_fields = ['username', 'email']
list_display = ('username', 'email')
class ClaimAdminForm(forms.ModelForm): class ClaimAdminForm(forms.ModelForm):
work = AutoCompleteSelectField( work = AutoCompleteSelectField(
@ -39,6 +40,7 @@ class ClaimAdminForm(forms.ModelForm):
model = models.Claim model = models.Claim
class ClaimAdmin(ModelAdmin): class ClaimAdmin(ModelAdmin):
list_display = ('work', 'rights_holder', 'status')
date_hierarchy = 'created' date_hierarchy = 'created'
form = ClaimAdminForm form = ClaimAdminForm
@ -56,14 +58,17 @@ class RightsHolderAdmin(ModelAdmin):
form = RightsHolderAdminForm form = RightsHolderAdminForm
class PremiumAdmin(ModelAdmin): class PremiumAdmin(ModelAdmin):
list_display = ('campaign', 'amount', 'description')
date_hierarchy = 'created' date_hierarchy = 'created'
class CampaignAdmin(ModelAdmin): class CampaignAdmin(ModelAdmin):
list_display = ('work', 'created', 'status')
date_hierarchy = 'created' date_hierarchy = 'created'
exclude = ('edition', 'work', 'managers', 'publisher') exclude = ('edition', 'work', 'managers', 'publisher')
search_fields = ['work']
class WorkAdmin(ModelAdmin): class WorkAdmin(ModelAdmin):
search_fields = ('title',) search_fields = ['title']
ordering = ('title',) ordering = ('title',)
list_display = ('title', 'created') list_display = ('title', 'created')
date_hierarchy = 'created' date_hierarchy = 'created'
@ -143,6 +148,7 @@ class CeleryTaskAdmin(ModelAdmin):
pass pass
class TransactionAdmin(ModelAdmin): class TransactionAdmin(ModelAdmin):
list_display = ('campaign', 'user', 'amount', 'status', 'error')
date_hierarchy = 'date_created' date_hierarchy = 'date_created'
class PaymentResponseAdmin(ModelAdmin): class PaymentResponseAdmin(ModelAdmin):