下面是我在views.py中的搜索视图(我已经导入了所需的所有模型): # if the user actually fills up the form': searched, 'posts': posts}) return render(request, 'blog/search.html', {})c
我正在尝试翻译一个模型类上已经存在的字段。我在第一步就被卡住了,那就是在Category中子类化TranslatableModel类,并添加TranslatedFields包装器来翻译选定的模型字段。我正在阅读一本名为“django by Example”的书,以及关于如何做到这一点的django-parler ,但是我得到了以下错误:
File ....'{0}' already has a field name
我试图使用DRF来制作一个选举跟踪器;获得被认为相当简单的ViewSet列表并检索端点;
django.core.exceptions.ImproperlyConfigured: Could not resolve如果我从ElectionSerializer.Meta.fields中删除"url“,那么个人的‘选举细节’视图看起来很好(也就是说,我可以在/api/v1/elections/nia.2016-05-我的理解是,ReadOnlyModelVie