Tweak the admin interface for emailaddress a bit.
- Legacy-Id: 2851
This commit is contained in:
parent
ed31b7ef2b
commit
995f176eb1
|
@ -35,8 +35,9 @@ class DocumentCommentAdmin(admin.ModelAdmin):
|
|||
admin.site.register(DocumentComment, DocumentCommentAdmin)
|
||||
|
||||
class EmailAddressAdmin(admin.ModelAdmin):
|
||||
list_display=('id', 'person_link', 'address', 'type', 'priority')
|
||||
list_display=('id', 'person_link', 'address', 'type', 'priority_link')
|
||||
search_fields=['address']
|
||||
raw_id_fields=['person_or_org', ]
|
||||
admin.site.register(EmailAddress, EmailAddressAdmin)
|
||||
|
||||
class GoalMilestoneAdmin(admin.ModelAdmin):
|
||||
|
|
|
@ -826,6 +826,12 @@ class EmailAddress(models.Model):
|
|||
def __str__(self):
|
||||
return self.address
|
||||
person_link = admin_link('person_or_org')
|
||||
def priority_link(self):
|
||||
if self.type=="I-D":
|
||||
return '<a href="/admin/idtracker/internetdraft/%s/">%s</a>' % (self.priority, self.priority)
|
||||
else:
|
||||
return self.priority
|
||||
priority_link.allow_tags = True
|
||||
class Meta:
|
||||
db_table = 'email_addresses'
|
||||
#unique_together = (('email_priority', 'person_or_org'), )
|
||||
|
|
Loading…
Reference in a new issue