Hi All!

In admin.py I created special column named 'downloading list'
========
class TenderAdmin(...):
    # in this column I show url to all downloads for tender
    list_display = ( ...., 'downloading_list',)

    def downloading_list(self, obj):
        return obj.get_downloading_list_url()
    downloading_list.short_description = 'downloading list'


In models.py
=========
class Tender(...):
    def get_downloading_list_url(self):
        # this url showing all downloads for this tender
        return "<a href='/admin/tenders/download/?tender__id__exact=
%s'>pokaż</a>" % self.id

and my question:
how to create automatically this url: ('/admin/tenders/download/?
tender__id__exact=%s' % self.id) ? to save dry principles
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to