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!