1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

remove class definition

This commit is contained in:
Christoph Schneider
2022-08-13 14:01:07 +02:00
parent ac540b6183
commit 36491b13d8

View File

@ -560,28 +560,3 @@ class MarkdownColumn(tables.TemplateColumn):
def value(self, 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