This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2018-11-16 12:08:37 +00:00
|
|
|
"""passbook admin api utils"""
|
|
|
|
# from django.db.models import Model
|
|
|
|
# from rest_framework.serializers import ModelSerializer
|
2018-11-16 08:10:35 +00:00
|
|
|
|
|
|
|
|
2018-11-16 12:08:37 +00:00
|
|
|
# class LookupSerializer(ModelSerializer):
|
2018-11-16 08:10:35 +00:00
|
|
|
|
2018-11-16 12:08:37 +00:00
|
|
|
# mapping = {}
|
2018-11-16 08:10:35 +00:00
|
|
|
|
2018-11-16 12:08:37 +00:00
|
|
|
# def to_representation(self, instance):
|
|
|
|
# for __model, __serializer in self.mapping.items():
|
|
|
|
# if isinstance(instance, __model):
|
|
|
|
# return __serializer(instance=instance).to_representation(instance)
|
|
|
|
# raise KeyError(instance.__class__.__name__)
|
2018-11-16 08:10:35 +00:00
|
|
|
|
2018-11-16 12:08:37 +00:00
|
|
|
# class Meta:
|
|
|
|
# model = Model
|
|
|
|
# fields = '__all__'
|