mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-16 00:13:12 +00:00
serialization des rappel de fin de connexion
This commit is contained in:
parent
7575453126
commit
e723ce018d
4 changed files with 33 additions and 0 deletions
|
@ -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.
|
||||||
|
|
|
@ -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),
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue