Monday 18 February 2013

add custom link href in django admin interface

Hi :)
step1 ) first go to your app folder and them select admin.py file
step 2 ) now
class Player(admin.ModelAdmin):     
    list_display =['id','Name','Mail','Facebook_link']
    def facebook_link(self,obj):
        return '<a href="%s">Facebook</a>'%('http://www.facebook.com')
    facebook_link.allow_tags = True
    facebook_link.short_dscription = "Facebook"


No comments:

Post a Comment