前に参照のローカル変数「TOTOは、」私はジャンゴでエラーを持って、私は解決策を見つけることができませんでした:UnboundLocalErrorは:割り当て
が割り当て 前に参照さUnboundLocalError /アイデンティティ/ RECHERCHEローカル変数「TOTO」においては、これが私のスクリプトの一部です:
def Consultation(request) :
identity = Identity.objects.all().order_by("-id")[:10] #Les 10 dernières fiches créées
identity_France = Identity.objects.filter(country='64').order_by("-id")[:10] #Les 10 dernières fiches où la personne habite en France
query = request.GET.get('q')
if query :
toto = Identity.objects.filter(lastname__icontains=query)
context = {
"identity" : identity,
"identity_France" : identity_France,
"query" : query,
"toto" : toto,
}
return render(request, 'resume.html', context)
はそんなに:)
012ありがとう
[東都](https://www.youtube.com/watch?v=FTQbiNvZqaY0)? –
@DanielRoseman良い冗談;)フランスでは、totoは共通の変数名です:P – Deadpool