1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 18:08:21 +02:00

Minor fixes on consumptions page, research is now faster

This commit is contained in:
Yohann D'ANELLO
2020-03-13 10:29:27 +01:00
parent a1f8ef721a
commit 8c795c38dc
5 changed files with 14 additions and 9 deletions

View File

@ -70,11 +70,15 @@ class AliasSerializer(serializers.ModelSerializer):
REST API Serializer for Aliases.
The djangorestframework plugin will analyse the model `Alias` and parse all fields in the API.
"""
note = serializers.SerializerMethodField()
class Meta:
model = Alias
fields = '__all__'
def get_note(self, alias):
return NotePolymorphicSerializer().to_representation(alias.note)
class NotePolymorphicSerializer(PolymorphicSerializer):
model_serializer_mapping = {