mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-30 20:36:26 -06:00
remove class definition
This commit is contained in:
parent
0af430baa7
commit
5471a6b333
@ -559,29 +559,4 @@ class MarkdownColumn(tables.TemplateColumn):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def value(self, value):
|
def value(self, value):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
class CustomFieldMarkdownColumn(tables.TemplateColumn):
|
|
||||||
"""
|
|
||||||
Render a Markdown string in a longtext custom column.
|
|
||||||
"""
|
|
||||||
template_code = """
|
|
||||||
{% if value %}
|
|
||||||
{{ value|markdown }}
|
|
||||||
{% else %}
|
|
||||||
—
|
|
||||||
{% endif %}
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, customfield, *args, **kwargs):
|
|
||||||
self.customfield = customfield
|
|
||||||
kwargs['accessor'] = Accessor(f'custom_field_data__{customfield.name}')
|
|
||||||
kwargs['template_code'] = self.template_code
|
|
||||||
if 'verbose_name' not in kwargs:
|
|
||||||
kwargs['verbose_name'] = customfield.label or customfield.name
|
|
||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
def value(self, value):
|
|
||||||
return value
|
|
Loading…
Reference in New Issue
Block a user