seems like
import re
is missing at beginning of function.
Alex
Am Dienstag, 20. August 2013 18:47:29 UTC+2 schrieb REM:
>
> There appears to be another error in the 5th Edition Web2Py book in
> Chapter 7 on P.369.
>
> The issue is with the following code block:
>
> def list_records():
> REGEX = re.compile('^(\w+).(\w+).(\w+)\=\=(\d+)$')
> match = REGEX.match(request.vars.query)
> if not match:
> redirect(URL('error'))
> table, field, id = match.group(2), match.group(3), match.group(4)
> records = db(db[table][field]==id).select()
> return dict(records=records)
>
> When the related action is run, we get the following error:
>
> *<type 'exceptions.NameError'> global name 're' is not defined
> *
> And referring to line 2 of the above function as being the source of the
> issue:
>
> REGEX = re.compile('^(\w+).(\w+).(\w+)\=\=(\d+)$')
>
> So, my question is: with what do we replace the "re" in the problem line?
>
>
>
> Many thanks!
>
>
>
>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.