Tweak the admin interface for Documents a bit.
- Legacy-Id: 4153
This commit is contained in:
parent
59aedbe937
commit
0dd2563b22
|
@ -111,14 +111,15 @@ class DocAliasAdmin(admin.ModelAdmin):
|
|||
list_display = [ 'name', 'document_link', ]
|
||||
search_fields = [ 'name', 'document__name', ]
|
||||
raw_id_fields = ['document']
|
||||
document_link = admin_link("document")
|
||||
admin.site.register(DocAlias, DocAliasAdmin)
|
||||
|
||||
|
||||
# events
|
||||
|
||||
class DocEventAdmin(admin.ModelAdmin):
|
||||
list_display = ["doc", "type", "by", "time"]
|
||||
def rev(obj):
|
||||
return obj.doc.rev
|
||||
list_display = ["doc", "type", "rev", "by", "time"]
|
||||
search_fields = ["doc__name", "by__name"]
|
||||
raw_id_fields = ["doc", "by"]
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ from django.conf import settings
|
|||
from ietf.group.models import *
|
||||
from ietf.name.models import *
|
||||
from ietf.person.models import Email, Person
|
||||
from ietf.utils.admin import admin_link
|
||||
|
||||
import datetime, os
|
||||
|
||||
|
@ -266,6 +267,7 @@ class DocAlias(models.Model):
|
|||
name = models.CharField(max_length=255, db_index=True)
|
||||
def __unicode__(self):
|
||||
return "%s-->%s" % (self.name, self.document.name)
|
||||
document_link = admin_link("document")
|
||||
class Meta:
|
||||
verbose_name = "document alias"
|
||||
verbose_name_plural = "document aliases"
|
||||
|
|
Loading…
Reference in a new issue