Commit 4ac011db by Kálmán Viktor

network: show addresses on record list (issue #14)

parent 9c7ba32e
...@@ -90,6 +90,9 @@ class SmallHostTable(Table): ...@@ -90,6 +90,9 @@ class SmallHostTable(Table):
class RecordTable(Table): class RecordTable(Table):
fqdn = LinkColumn('network.record', args=[A('pk')], orderable=False) fqdn = LinkColumn('network.record', args=[A('pk')], orderable=False)
address = TemplateColumn(
template_name="network/columns/records-address.html"
)
class Meta: class Meta:
model = Record model = Record
......
{% if record.host %}
{% if record.type == "A" %}
{{ record.host.ipv4 }}
{% elif record.type == "AAAA" %}
{{ record.host.ipv6 }}
{% elif record.type == "CNAME" %}
{{ record.host.get_fqdn }}
{% elif record.type == "MX" %}
{{ record.host.get_fqdn }}
{% else %}
This should not appear!
{% endif %}
{% else %}
{{ record.address }}
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment