Найти - Пользователи
Полная версия: object has no attribute '_clone'
Начало » Django » object has no attribute '_clone'
1
I159
При передаче значения через url, получил ошибку:
'CarModel' object has no attribute ‘_clone’
URL:
(r'^sell/(?P<make>\w+)/(?P<the_model>\w+)/$', views.sell_detail),
Представление:
def sell_detail(request, make, the_model):

return list_detail.object_list(
request,
queryset = CarModel.objects.get(car_model__iexact = the_model),
template_name = 'sell_detail.html',
template_object_name = 'detail',
extra_context = {'make': make, 'the_model': the_model}
)
Читаю Google, говорят что - баг. Что именно происходит и что с этим делать?
svas
Может так заработает
def sell_detail(request, make, the_model):

return list_detail.object_list(
request,
queryset = CarModel.objects.filter(car_model__iexact = the_model),
template_name = 'sell_detail.html',
template_object_name = 'detail',
extra_context = {'make': make, 'the_model': the_model}
)
I159
Вопрос решил. В представлении опосредовано дважды вызывался экземпляр класса CarModel.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB