How to popup a window from admin site from the admin table's cell html content?

31 views
Skip to first unread message

Aditya Sriram M

unread,
May 19, 2012, 9:01:05 AM5/19/12
to django...@googlegroups.com
I have a function like this..

list_display = (..,get_link_to_users, ..)

   def get_link_to_users(self, obj):
        html_table = '<a href="JavaScript:window.open(''../user/?q=%s'');"> My Users </a>' % (obj.customer_id)
        print html_table
        return html_table
    get_link_to_fortress_users.short_description = 'Fortress Users'
    get_link_to_fortress_users.allow_tags = True

Question: user and customer are my models. In Customer model, I would like to put just the link. And on clicking this link, a new popup should come up with the related users. How to do this?

Aditya Sriram M

unread,
May 20, 2012, 11:51:21 PM5/20/12
to django...@googlegroups.com
Help please! :-|

francescortiz

unread,
May 25, 2012, 9:18:45 AM5/25/12
to django...@googlegroups.com
You need to be more specific, because the code you have already seems to do what you ask. What is your problem?
Reply all
Reply to author
Forward
0 new messages