Issue
I am currently following a web2py tutorial and I am asked to append to my controls/default.py:
def entry_post():
"""returns a form where the can entry a post"""
form = crud.create(db.post)
return dict(form=form)
Which is fine but if I try to go to: mywebsite/app/default/entry_post I get a ticket error: global name 'crud' is not defined
Now, I've read the web2py documentation and I know that crud.create(db.table) is a valid syntax, so why does this happen?
Thanks for your answer
Solution
BTW. Crud is an old API which we no longer support.
form = crud.create(db.post)
should be rewritten as
form = SQLFORM(db.post).process()
Answered By - Massimo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.