>>  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.
>   
Thanks for your help, this is the code, what I want to do is call the
function viaje defined before. I can use that same function if I call it
from my urls.py but it doesn't work from the views.py file.

def viaje(request, numero=None):
+-- 37 lines: "Genera un informe detallado de un viaje"---------

def viajes(request):
   "Genera listados de viajes por distintos criterios"
   clie = 'Todos'
   prov = 'Todos'
   desde = 'Sin limite'
   hasta = 'Sin limite'
   paxs = 'Todos'
   viajes = amxdev.vtour.models.viaje().getAllObjects()
   if request.GET['numero'] != '':
      resp = viaje(request)
      return resp

Facundo


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn:Facundo Casco
n:Casco;Facundo
org:AMV Multiviajes Argentina S.R.L.
adr:Piso 12 Oficina 'G';;Esmeralda 847;Buenos Aires;CF;C1007ABI;Argentina
email;internet:[EMAIL PROTECTED]
tel;work:+54 11 5031-3060 / 3061
tel;fax:+54 11 4313-6141
url:http://www.multiviajesar.com.ar
version:2.1
end:vcard

Reply via email to