8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 15:33:45 +00:00
re2o/cotisations/api/views.py

84 lines
2.9 KiB
Python
Raw Normal View History

# -*- mode: python; coding: utf-8 -*-
2020-11-23 16:06:37 +00:00
# Re2o est un logiciel d'administration développé initiallement au Rézo Metz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2018 Maël Kervella
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2021-02-10 10:06:09 +00:00
from rest_framework import generics, viewsets
import cotisations.models as cotisations
2020-04-21 12:00:52 +00:00
import preferences.models as preferences
2021-02-10 10:06:09 +00:00
from . import serializers
class FactureViewSet(viewsets.ReadOnlyModelViewSet):
2021-02-10 10:06:09 +00:00
"""Exposes list and details of `cotisations.models.Facture` objects."""
queryset = cotisations.Facture.objects.all()
serializer_class = serializers.FactureSerializer
class FactureViewSet(viewsets.ReadOnlyModelViewSet):
2021-02-10 10:06:09 +00:00
"""Exposes list and details of `cotisations.models.Facture` objects."""
queryset = cotisations.BaseInvoice.objects.all()
serializer_class = serializers.BaseInvoiceSerializer
class VenteViewSet(viewsets.ReadOnlyModelViewSet):
2021-02-10 10:06:09 +00:00
"""Exposes list and details of `cotisations.models.Vente` objects."""
queryset = cotisations.Vente.objects.all()
serializer_class = serializers.VenteSerializer
class ArticleViewSet(viewsets.ReadOnlyModelViewSet):
2021-02-10 10:06:09 +00:00
"""Exposes list and details of `cotisations.models.Article` objects."""
queryset = cotisations.Article.objects.all()
serializer_class = serializers.ArticleSerializer
class BanqueViewSet(viewsets.ReadOnlyModelViewSet):
2021-02-10 10:06:09 +00:00
"""Exposes list and details of `cotisations.models.Banque` objects."""
queryset = cotisations.Banque.objects.all()
serializer_class = serializers.BanqueSerializer
class PaiementViewSet(viewsets.ReadOnlyModelViewSet):
2021-02-10 10:06:09 +00:00
"""Exposes list and details of `cotisations.models.Paiement` objects."""
queryset = cotisations.Paiement.objects.all()
serializer_class = serializers.PaiementSerializer
class CotisationViewSet(viewsets.ReadOnlyModelViewSet):
2021-02-10 10:06:09 +00:00
"""Exposes list and details of `cotisations.models.Cotisation` objects."""
queryset = cotisations.Cotisation.objects.all()
serializer_class = serializers.CotisationSerializer
2020-04-21 12:00:52 +00:00
class ReminderView(generics.ListAPIView):
2021-02-10 10:06:09 +00:00
"""Output for users to remind an end of their subscription."""
2020-04-21 12:00:52 +00:00
queryset = preferences.Reminder.objects.all()
2021-02-10 10:06:09 +00:00
serializer_class = serializers.ReminderSerializer