Denes,
I adjusted the cityAC function according to your directions. It still
isn't working, but at least the application is issuing a ticket.
When I expose the function and type a plaatsnaam in the auto complete
field, after I type the first letter the drop box displays: 'Internal
error Ticket issued:..' I have not seen this behaviour before,
normally this message appears on a blank page.
The ticket reads like:
(dp1
S'output'
p2
S''
sS'layer'
p3
S'/Library/Python/2.5/site-packages/web2py/applications/b2c/
controllers/handlers.py'
p4
sS'code'
p5
S"def cityAC():\n q=''\n if request.vars:\n
q=request.vars.q\n if not q:\n return q\n rows=db
(db.adres.plaatsnaam.like('%s%%'%q.capitalize()))\\\n .select
(db.adres.plaatsnaam,distinct=True)\n r=''\n for row in rows:
\n r='%s%s\\n'(%r,row.plaatsnaam)\n return r\n\n
\nresponse._vars=response._caller(cityAC)"
p6
sS'traceback'
p7
S'Traceback (most recent call last):\n File "/Library/Python/2.5/site-
packages/web2py/gluon/restricted.py", line 61, in restricted\n
else: ccode=compile(code.replace(\'\\r\\n\',\'\\n\'),layer,\'exec\')
\n File "/Library/Python/2.5/site-packages/web2py/applications/b2c/
controllers/handlers.py", line 11\n r=\'%s%s\\n\'(%r,row.plaatsnaam)
\n ^\nSyntaxError: invalid syntax\n'
p8
s.
My cityAC function reads like:
def cityAC():
q=''
if request.vars:
q=request.vars.q
if not q:
return q
rows=db(db.adres.plaatsnaam.like('%s%%'%q.capitalize()))\
.select(db.adres.plaatsnaam,distinct=True)
r=''
for row in rows:
r='%s%s\n'(%r,row.plaatsnaam)
return r
I guess we have almost got it working, since the problem seems to be
in this last line of code.
Best regards,
Annet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---