On 9/6/06, Facundo Casco <[EMAIL PROTECTED]> wrote: > > Hi, maybe I'm doing something wrong (I'm just starting to learn Python and > Django), I need to call a view (viaje) from another view in the same app but > I get this error: > > UnboundLocalError at /adm/viaj/ > local variable 'viaje' referenced before assignment
You have an assignment to a local variable named 'viaje', but you are using the name 'viaje' before that assignment. Look for a line that begins "viaje =". It's best not to have variables and functions with the same name. If you're still having trouble, please post the last ten or fifteen lines of the stacktrace, plus the complete code for the function with the UnboundLocalError, and someone will be able to pinpoint the problem for you. Regards, Alan. > > The relevant part of the code is > > amxdev/contable/views.py > ... > > def viajes(request): > if request.GET['numero'] != '': > resp = viaje(request) > return resp > > > def viaje(request, numero=None): > ... > return render_to_response(...) > > > > Thanks for your help. > > > Facundo > > > > -- Alan Green [EMAIL PROTECTED] - http://bright-green.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---