Re: drf - change Foreign key to another field in a serializer using modelviewset

2019-02-07 Thread Okware Aldo
Hi, I think you should consider creating a custom serializer, where you can modify that field, though I would advise you create another or modify yo return the json object of the organiser. https://www.django-rest-framework.org/api-guide/fields/#serializermethodfield On Thu, Feb 7, 2019 at

Re: drf - change Foreign key to another field in a serializer using modelviewset

2019-02-07 Thread Ing.Daniel Bojorge
Hi. You can customize the queryset. Dios L@s Bendiga Saludos, [image: --] daniel.bojorge [image: http://]about.me/daniel.bojorge *Domina el ORM Django* *Curso Desarrollo Web con Python usando Django 2.1 Para

drf - change Foreign key to another field in a serializer using modelviewset

2019-02-07 Thread cyril moreau
Hi, I have a ModelViewSet class as : class EventAPIListCreate( viewsets.ModelViewSet): queryset = EventAPI.objects.all() serializer_class = EventAPISerializer and my serializer looks like : class EventAPISerializer(serializers.ModelSerializer): class Meta: model = EventAPI