예제 #1
0
파일: views.py 프로젝트: rajabiy/smyt
 def get(self, request, fomat=None):
     keys = []
     for key, value in models_dict.iteritems():
         keys.append(key)
     return Response(keys)
예제 #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
예제 #3
0
 def get(self, request, fomat=None):
     keys = []
     for key, value in models_dict.iteritems():
         keys.append(key)
     return Response(keys)