Browse Source

TTL for DNAMEs

display_preferences
Hugo Levy-Falk 6 years ago
committed by chirac
parent
commit
13a06c1a67
  1. 20
      machines/migrations/0105_dname_ttl.py
  2. 4
      machines/models.py
  3. 2
      machines/templates/machines/aff_dname.html

20
machines/migrations/0105_dname_ttl.py

@ -0,0 +1,20 @@
# -*- 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)'),
),
]

4
machines/models.py

@ -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 = (

2
machines/templates/machines/aff_dname.html

@ -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 %}

Loading…
Cancel
Save