Commit 13a06c1a authored by klafyvel's avatar klafyvel Committed by chirac

TTL for DNAMEs

parent aab6fa2b
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-10-02 21:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('machines', '0104_auto_20191002_2231'),
]
operations = [
migrations.AddField(
model_name='dname',
name='ttl',
field=models.PositiveIntegerField(default=172800, verbose_name='Time To Live (TTL)'),
),
]
......@@ -915,6 +915,10 @@ class DName(RevMixin, AclMixin, models.Model):
"""A DNAME entry for the DNS."""
zone = models.ForeignKey('Extension', on_delete=models.PROTECT)
alias = models.CharField(max_length=255)
ttl = models.PositiveIntegerField(
verbose_name=_("Time To Live (TTL)"),
default=172800, # 2 days
)
class Meta:
permissions = (
......
......@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<th>{% trans "Target zone" %}</th>
<th>{% trans "Record" %}</th>
<th>{% trans "TTL" %}</th>
<th></th>
</tr>
</thead>
......@@ -36,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>{{ dname.zone }}</td>
<td>{{ dname.dns_entry }}</td>
<td>{{ dname.ttl }}</td>
<td class="text-right">
{% can_edit dname %}
{% include 'buttons/edit.html' with href='machines:edit-dname' id=dname.id %}
......
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 to comment