Opened 18 years ago

Last modified 18 years ago

#766 closed enhancement

[patch, new-admin] Allow html tags if "allow_tags" model's method attribute is present — at Initial Version

Reported by: plisk Owned by: rjwittams
Component: contrib.admin Version:
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Subj, to use like shown below. It allows to include html in object list. Patch against revision 1153, change is in function items_for_result.

class Policy(meta.Model):

subject = meta.CharField(maxlength=100)
date_added = meta.DateTimeField('Date Added', default=datetime.today())

def link_view(self):

return '<a href="' + str(self.id) + '/view/' + '">view</a>'

link_view.short_description = 'Action'
link_view.allow_tags = True

class META:

admin = meta.Admin(

list_display = ('subject', 'date_added', 'link_view'),

)

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top