【发布时间】:2017-06-08 09:39:21
【问题描述】:
当我通过 post 方法请求时发生错误。
views.py
class ConceptForkView(ConceptBaseView, mixins.CreateModelMixin):
print 'oclapi ConceptForkView111'
def dispatch(self, request, *args, **kwargs):
print 'oclapi ConceptForkView dispatch'
return super(ConceptForkView, self).dispatch(request, *args, **kwargs)
def post(self, request):
print 'oclapi ConceptForkView post'
urls.py
url(r'^forking/$', ConceptForkView.as_view(), name='concept-forking'),
概念基础视图
class ConceptBaseView(ChildResourceMixin):
lookup_field = 'concept'
pk_field = 'mnemonic'
model = Concept
permission_classes = (CanViewParentDictionary,)
child_list_attribute = 'concepts'
print 'oclapi ConceptForkView111' 命令可以运行,但是方法 dispatch 和 post 不运行。是什么原因?
我已经搜索了许多解决方案,但它们对我不起作用。我怎么解决这个问题?谢谢。
【问题讨论】:
-
你没有提供
ChildResourceMixin是什么的线索
标签: django django-rest-framework