Ejemplo n.º 1
0
 def get(self, request, fomat=None):
     keys = []
     for key, value in models_dict.iteritems():
         keys.append(key)
     return Response(keys)
Ejemplo n.º 2
0
# coding=utf-8
from rest_framework import serializers
from dclass.models import models_dict


serializers_dict = dict()

#Генерерируем сериализаторы для моделей
for key, value in models_dict.iteritems():
    meta = type('Meta', (), {'model': value})
    serializer = type('Ser%s' % value.__name__, (serializers.ModelSerializer,), {'Meta': meta})
    serializers_dict[key] = serializer
Ejemplo n.º 3
0
 def get(self, request, fomat=None):
     keys = []
     for key, value in models_dict.iteritems():
         keys.append(key)
     return Response(keys)