<s> from __future__ import absolute_import , unicode_literals <EOL> from django . utils . functional import cached_property <EOL> from django . utils . html import format_html <EOL> from wagtail . wagtailcore . blocks import ChooserBlock <EOL> class DocumentChooserBlock ( ChooserBlock ) : <EOL> @ cached_property <EOL> def target_model ( self ) : <EOL> from wagtail . wagtaildocs . models import get_document_model <EOL> return get_document_model ( ) <EOL> @ cached_property <EOL> def widget ( self ) : <EOL> from wagtail . wagtaildocs . widgets import AdminDocumentChooser <EOL> return AdminDocumentChooser <EOL> def render_basic ( self , value ) : <EOL> if value : <EOL> return format_html ( '<STR_LIT>' , value . url , value . title ) <EOL> else : <EOL> return '<STR_LIT>' <EOL> class Meta : <EOL> icon = "<STR_LIT>" </s>
