Module ImportFrom alias ImportFrom alias alias TryExcept body ImportFrom alias Assign NameStore AttributeLoad NameLoad attr ImportFrom alias Assign NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body ImportFrom alias alias Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body Assign NameStore Str Assign NameStore Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr TupleLoad Call NameLoad Str keyword Str keyword Str keyword NameLoad keyword Str Call NameLoad Str keyword Str keyword Str keyword NameLoad keyword Str FunctionDef arguments args NameParam defaults vararg kwarg body If CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad Str Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call NameLoad NameLoad If SubscriptLoad NameLoad Index Str body Assign NameStore ListComp BinOpAdd NameLoad Str comprehension NameStore NameLoad Assign NameStore ListComp BinOpMod NameLoad Dict Str NameLoad comprehension NameStore NameLoad Print BinOpMod NameLoad Dict Str Str Str BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call AttributeLoad Str attr NameLoad BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad orelse If SubscriptLoad NameLoad Index Str body Assign NameStore ListComp BinOpAdd NameLoad Str comprehension NameStore NameLoad Assign NameStore ListComp BinOpMod NameLoad Dict Str Str BinOpAdd Call AttributeLoad NameLoad attr Str NameLoad comprehension NameStore NameLoad Print BinOpMod NameLoad Dict Str Str BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad orelse Assign NameStore ListComp BinOpMod NameLoad Dict Str NameLoad comprehension NameStore NameLoad Print BinOpMod NameLoad Dict Str Str BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad decorator_list decorator_list
N/A optparse make_option django.core.management.base BaseCommand CommandError N/A N/A django.apps apps N/A get_app N/A apps get_app_config django.apps.registry AppConfig N/A get_models N/A AppConfig get_models N/A N/A N/A ImportError N/A django.db.models.loading get_app get_models N/A serializers from rest_framework import serializers
%(model_imports)s
%(classes)s
 N/A serializer_class_def 

class %(model)sSerializer(serializers.ModelSerializer):
    class Meta:
        model = %(model)s
 N/A viewsets from rest_framework import viewsets
%(model_imports)s
%(serializer_imports)s
%(classes)s
 N/A viewset_class_def 

class %(model)sViewSet(viewsets.ModelViewSet):
    queryset = %(model)s.objects.all()
    serializer_class = %(model)sSerializer
 N/A urls from django.conf.urls import url, include
from rest_framework import routers
from . import views

router = routers.DefaultRouter()
%(router_defs)s

urlpatterns = [
    url(r'^', include(router.urls)),
]
 N/A router_def router.register(r'%(model_api_name)s', views.%(model)sViewSet)
 Command N/A BaseCommand N/A N/A args <app_name> N/A help Generates serializers and viewsets (with --viewsets) for DRF N/A option_list N/A N/A BaseCommand option_list N/A N/A make_option --viewsets action store_true dest viewsets default False help Generate viewsets N/A make_option --urls action store_true dest urls default False help Generate urls handle N/A N/A self N/A args options N/A N/A N/A N/A len args 1 N/A N/A N/A CommandError Please supply an app name N/A app_name N/A args N/A 0 N/A app N/A get_app app_name N/A model_names N/A N/A model __name__ N/A model N/A get_models app N/A N/A options N/A viewsets N/A N/A serializer_names N/A N/A model_name Serializer N/A model_name model_names N/A class_defs N/A N/A viewset_class_def N/A model name N/A name model_names N/A N/A viewsets N/A model_imports serializer_imports classes N/A N/A N/A from  app_name .models import  N/A N/A ,  join model_names N/A N/A N/A from  app_name .serializers import  N/A N/A ,  join serializer_names N/A N/A join class_defs N/A N/A N/A options N/A urls N/A N/A view_names N/A N/A model_name ViewSet N/A model_name model_names N/A router_defs N/A N/A router_def N/A model_api_name model N/A N/A N/A model_name lower s model_name N/A model_name model_names N/A N/A urls N/A view_imports router_defs N/A N/A N/A from  app_name .views import  N/A N/A ,  join view_names N/A N/A join router_defs N/A N/A class_defs N/A N/A serializer_class_def N/A model name N/A name model_names N/A N/A serializers N/A model_imports classes N/A N/A N/A from  app_name .models import  N/A N/A ,  join model_names N/A N/A join class_defs N/A N/A