mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-27 00:40:40 +03:00
12 lines
360 B
Python
12 lines
360 B
Python
from djangorestframework.serializers import ModelSerializer
|
|
from djangorestframework.generics import RootAPIView, InstanceAPIView
|
|
|
|
class ModelResource (object):
|
|
serializer_class = ModelSerializer
|
|
collection_view_class = RootAPIView
|
|
instance_view_class = InstanceAPIView
|
|
|
|
collection_name = None
|
|
instance_name = None
|
|
id_field_name = 'pk'
|