Opened 19 years ago

Last modified 19 years ago

#766 closed enhancement

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

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 (last modified by hugo)

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 (2)

comment:1 by hugo, 19 years ago

Description: modified (diff)

by plisk, 19 years ago

Attachment: admin_list.patch added

Add support for allow_tags attribute

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