def __init__(self, target_model, filter_name=None, **kwargs):
super(ModelChooserBlock, self).__init__(**kwargs)
self._target_model = target_model
self.filter_name = filter_name
if self.meta.icon == 'placeholder':
# Get the icon from the chooser.
# The chooser may not have been registered yet, depending upon
# import orders and things, so get the icon lazily
self.meta.icon = lazy(lambda: self.chooser.icon, str)()
评论列表
文章目录