8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-09 19:36:27 +00:00

Merge branch 'reminder-serializer' into 'dev'

serialization des rappel de fin de connexion

See merge request federez/re2o!317
This commit is contained in:
chirac 2018-09-29 16:53:27 +02:00
commit b6ded7720a
4 changed files with 33 additions and 0 deletions

View file

@ -957,6 +957,26 @@ class DNSZonesSerializer(serializers.ModelSerializer):
'mx_records', 'txt_records', 'srv_records', 'a_records', 'mx_records', 'txt_records', 'srv_records', 'a_records',
'aaaa_records', 'cname_records', 'sshfp_records') 'aaaa_records', 'cname_records', 'sshfp_records')
#REMINDER
class ReminderUsersSerializer(UserSerializer):
"""Serialize the data about a mailing member.
"""
class Meta(UserSerializer.Meta):
fields = ('get_full_name', 'email')
class ReminderSerializer(serializers.ModelSerializer):
"""
Serialize the data about a reminder
"""
users_to_remind = ReminderUsersSerializer(many=True)
class Meta:
model = preferences.Reminder
fields = ('days','message','users_to_remind')
class DNSReverseZonesSerializer(serializers.ModelSerializer): class DNSReverseZonesSerializer(serializers.ModelSerializer):
"""Serialize the data about DNS Zones. """Serialize the data about DNS Zones.

View file

@ -110,6 +110,8 @@ router.register_view(r'firewall/interface-ports', views.InterfacePortsOpenView),
# Switches config # Switches config
router.register_view(r'switchs/ports-config', views.SwitchPortView), router.register_view(r'switchs/ports-config', views.SwitchPortView),
router.register_view(r'switchs/role', views.RoleView), router.register_view(r'switchs/role', views.RoleView),
# Reminder
router.register_view(r'reminder/get-users', views.ReminderView),
# DNS # DNS
router.register_view(r'dns/zones', views.DNSZonesView), router.register_view(r'dns/zones', views.DNSZonesView),
router.register_view(r'dns/reverse-zones', views.DNSReverseZonesView), router.register_view(r'dns/reverse-zones', views.DNSReverseZonesView),

View file

@ -539,6 +539,15 @@ class SwitchPortView(generics.ListAPIView):
serializer_class = serializers.SwitchPortSerializer serializer_class = serializers.SwitchPortSerializer
# Rappel fin adhésion
class ReminderView(generics.ListAPIView):
"""Exposes the associations between hostname, mac address and IPv4 in
order to build the DHCP lease files.
"""
queryset = preferences.Reminder.objects.all()
serializer_class = serializers.ReminderSerializer
class RoleView(generics.ListAPIView): class RoleView(generics.ListAPIView):
"""Exposes the associations between hostname, mac address and IPv4 in """Exposes the associations between hostname, mac address and IPv4 in

View file

@ -26,6 +26,7 @@ Reglages généraux, machines, utilisateurs, mail, general pour l'application.
from __future__ import unicode_literals from __future__ import unicode_literals
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.utils import timezone
from django.db import models from django.db import models
from django.db.models.signals import post_save from django.db.models.signals import post_save
from django.dispatch import receiver from django.dispatch import receiver
@ -37,6 +38,7 @@ import machines.models
from re2o.mixins import AclMixin from re2o.mixins import AclMixin
from re2o.aes_field import AESEncryptedField from re2o.aes_field import AESEncryptedField
from datetime import timedelta from datetime import timedelta