在视图.py
class LaViewSet(viewsets.ModelViewSet):
serializer_class = IlSerializer
def get_queryset(self):
ilfiltro = self.kwargs['miopar']
return models.Pippo.objects.filter(pippo=ilfiltro)
在网址.py
^{pr2}$这是一个有效的url:
http://127.0.0.1:8000/pippo/1
但如果我放一个模板:
{% url '1' 'Serializzata' %};
或者
{% url 'Serializzata'?1 %};
继续出现此错误:
TemplateSyntaxError: Could not parse the remainder: '?1' from ''Serializzata'?1'
从docs:
所以在你的情况下:
试试这个:
相关问题 更多 >
编程相关推荐