class ListaPercorsiAPI(APIView):
+
def get(self, request):
errors = []
error = False
if id_utente and id_percorso and valutazione:
- utente = User.objects.get(pk=int(id_utente))
+ utente = User.objects.filter(pk=int(id_utente))
if utente:
- percorso = Percorso.objects.get(pk=int(id_percorso))
+ percorso = Percorso.objects.filter(pk=int(id_percorso))
if percorso:
try:
Feedback.objects.create(
- utente=utente,
- percorso=percorso,
+ utente=utente.last(),
+ percorso=percorso.last(),
valutazione=int(valutazione),
commento=commento
)
class MultimediaSerializer(serializers.ModelSerializer):
class Meta:
model = Multimedia
- fields = ('id', 'nome', 'tipologia__nome', 'media', 'nome', 'descrizione', 'testo')
\ No newline at end of file
+ fields = ('id', 'nome', 'tipologia', 'media', 'nome', 'descrizione', 'testo')
\ No newline at end of file
'sistema',
'utenti',
'api',
+ 'rest_framework'
]
'rest_framework_simplejwt.authentication.JWTAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.BasicAuthentication',
+ 'rest_framework.authentication.TokenAuthentication',
),
}