Merge branch 'main' into nonfree_main
This commit is contained in:
commit
697acad9bc
|
|
@ -56,6 +56,29 @@ class PriceSerializer(serializers.ModelSerializer):
|
|||
]
|
||||
depth = 1
|
||||
|
||||
class ConfigurationSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Configuration
|
||||
fields = [
|
||||
"organisation",
|
||||
"short_description",
|
||||
"long_description",
|
||||
"adress",
|
||||
"phone",
|
||||
"email",
|
||||
"site_web",
|
||||
"twitter",
|
||||
"facebook",
|
||||
"instagram",
|
||||
"adhesion_obligatoire",
|
||||
"button_adhesion",
|
||||
"name_required_for_ticket",
|
||||
"map_img",
|
||||
"carte_restaurant",
|
||||
"img",
|
||||
"logo",
|
||||
]
|
||||
read_only_fields = fields
|
||||
|
||||
class EventSerializer(serializers.ModelSerializer):
|
||||
products = ProductSerializer(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from rest_framework.permissions import AllowAny
|
|||
from rest_framework.response import Response
|
||||
|
||||
from ApiBillet.serializers import EventSerializer, PriceSerializer, ProductSerializer, ReservationSerializer, \
|
||||
ReservationValidator, MembreshipValidator
|
||||
ReservationValidator, MembreshipValidator, ConfigurationSerializer
|
||||
from AuthBillet.models import TenantAdminPermission
|
||||
from Customers.models import Client, Domain
|
||||
from BaseBillet.models import Event, Price, Product, Reservation, Configuration, Ticket
|
||||
|
|
@ -83,8 +83,11 @@ class EventsViewSet(viewsets.ViewSet):
|
|||
|
||||
def list(self, request):
|
||||
queryset = Event.objects.all().order_by('-datetime')
|
||||
serializer = EventSerializer(queryset, many=True, context={'request': request})
|
||||
return Response(serializer.data)
|
||||
events_serialized = EventSerializer(queryset, many=True, context={'request': request})
|
||||
place_serialized = ConfigurationSerializer(Configuration.get_solo() , context={'request': request})
|
||||
|
||||
dict_response = {"events": events_serialized.data, "place": place_serialized.data}
|
||||
return Response(dict_response)
|
||||
|
||||
def retrieve(self, request, pk=None):
|
||||
queryset = Event.objects.all().order_by('-datetime')
|
||||
|
|
|
|||
|
|
@ -158,12 +158,11 @@ class Configuration(SingletonModel):
|
|||
verbose_name=_("Clé d'API du serveur cashless")
|
||||
)
|
||||
|
||||
ARNAUD, MASSIVELY, BLK_MVC, BLK_VUE = 'arnaud_mvc', 'html5up-masseively', 'blk-pro-mvc', 'blk_vue'
|
||||
ARNAUD, MASSIVELY, BLK_MVC = 'arnaud_mvc', 'html5up-masseively', 'blk-pro-mvc'
|
||||
CHOICE_TEMPLATE = [
|
||||
(ARNAUD, _('arnaud_mvc')),
|
||||
(MASSIVELY, _("html5up-masseively")),
|
||||
(BLK_MVC, _("blk-pro-mvc")),
|
||||
(BLK_VUE, _("blk_vue")),
|
||||
]
|
||||
# choices=[(folder, folder) for folder in os.listdir(f"{settings.BASE_DIR}/BaseBillet/templates")],
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue