标签:config book let site ret nbsp change bsp def
class BookConfig(ModelStark): def edit(self, obj=None, is_header=False): if is_header: return "操作" return mark_safe("<a href=‘/stark/app01/book/%s/change/‘>编辑</a>" % obj.pk) def delete(self,obj=None,is_header=False): if is_header: return "删除" return mark_safe("<a href=‘/stark/app01/book/%s/delete/‘>删除</a>" % obj.pk) list_display = ["title", "price","publish", "authors", edit, delete] site.register(Book, BookConfig) site.register(Publish) site.register(Author)
标签:config book let site ret nbsp change bsp def
原文地址:https://www.cnblogs.com/hnlmy/p/10698364.html