diff --git a/machines/admin.py b/machines/admin.py index 93e936e6..763cff43 100644 --- a/machines/admin.py +++ b/machines/admin.py @@ -27,7 +27,7 @@ from django.contrib import admin from reversion.admin import VersionAdmin from .models import IpType, Machine, MachineType, Domain, IpList, Interface -from .models import Extension, SOA, Mx, Ns, Vlan, Text, Nas, Service +from .models import Extension, SOA, Mx, Ns, Vlan, Txt, Nas, Service from .models import OuverturePort, OuverturePortList @@ -63,7 +63,7 @@ class NsAdmin(VersionAdmin): pass -class TextAdmin(VersionAdmin): +class TxtAdmin(VersionAdmin): pass @@ -102,7 +102,7 @@ admin.site.register(Extension, ExtensionAdmin) admin.site.register(SOA, SOAAdmin) admin.site.register(Mx, MxAdmin) admin.site.register(Ns, NsAdmin) -admin.site.register(Text, TextAdmin) +admin.site.register(Txt, TxtAdmin) admin.site.register(IpList, IpListAdmin) admin.site.register(Interface, InterfaceAdmin) admin.site.register(Domain, DomainAdmin) diff --git a/machines/forms.py b/machines/forms.py index 2c1c53c7..b043d9f5 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -47,7 +47,7 @@ from .models import ( Extension, SOA, Mx, - Text, + Txt, Ns, Service, Vlan, @@ -364,7 +364,7 @@ class DelNsForm(Form): class TxtForm(ModelForm): """Ajout d'un txt pour une zone""" class Meta: - model = Text + model = Txt fields = '__all__' def __init__(self, *args, **kwargs): @@ -375,7 +375,7 @@ class TxtForm(ModelForm): class DelTxtForm(Form): """Suppression d'un ou plusieurs TXT""" txt = forms.ModelMultipleChoiceField( - queryset=Text.objects.all(), + queryset=Txt.objects.all(), label="Enregistrements Txt actuels", widget=forms.CheckboxSelectMultiple ) diff --git a/machines/migrations/0065_auto_20171115_1514.py b/machines/migrations/0065_auto_20171115_1514.py new file mode 100644 index 00000000..c8c5699b --- /dev/null +++ b/machines/migrations/0065_auto_20171115_1514.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-11-15 14:14 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0064_auto_20171115_0253'), + ] + + operations = [ + migrations.RenameModel( + old_name='Text', + new_name='Txt', + ), + ] diff --git a/machines/models.py b/machines/models.py index 6453f08a..e3104f22 100644 --- a/machines/models.py +++ b/machines/models.py @@ -382,7 +382,7 @@ class Ns(models.Model): return str(self.zone) + ' ' + str(self.ns) -class Text(models.Model): +class Txt(models.Model): """ Un enregistrement TXT associé à une extension""" PRETTY_NAME = "Enregistrement TXT" @@ -920,13 +920,13 @@ def ns_post_delete(sender, **kwargs): regen('dns') -@receiver(post_save, sender=Text) +@receiver(post_save, sender=Txt) def text_post_save(sender, **kwargs): """Regeneration dns après modification d'un TXT""" regen('dns') -@receiver(post_delete, sender=Text) +@receiver(post_delete, sender=Txt) def text_post_delete(sender, **kwargs): """Regeneration dns après modification d'un TX""" regen('dns') diff --git a/machines/serializers.py b/machines/serializers.py index 7d78ebc3..6d128da4 100644 --- a/machines/serializers.py +++ b/machines/serializers.py @@ -31,7 +31,7 @@ from machines.models import ( IpList, MachineType, Domain, - Text, + Txt, Mx, Service_link, Ns, @@ -195,20 +195,20 @@ class MxSerializer(serializers.ModelSerializer): return str(obj.dns_entry) -class TextSerializer(serializers.ModelSerializer): +class TxtSerializer(serializers.ModelSerializer): """Serialisation d'un txt : zone cible et l'entrée txt sont evaluées à part""" zone = serializers.SerializerMethodField('get_zone_name') - text_entry = serializers.SerializerMethodField('get_text_name') + txt_entry = serializers.SerializerMethodField('get_txt_name') class Meta: - model = Text - fields = ('zone', 'text_entry', 'field1', 'field2') + model = Txt + fields = ('zone', 'txt_entry', 'field1', 'field2') def get_zone_name(self, obj): return str(obj.zone.name) - def get_text_name(self, obj): + def get_txt_name(self, obj): return str(obj.dns_entry) diff --git a/machines/templates/machines/aff_txt.html b/machines/templates/machines/aff_txt.html index eb060440..fd7c5ee6 100644 --- a/machines/templates/machines/aff_txt.html +++ b/machines/templates/machines/aff_txt.html @@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,