We are trying to deprecate crud therefore if you want to use you must 
define it:

from gluon.tools import Crud; crud = Crud(db);

Anyway, your code would be better written as:

    form = SQLFORM(db.post).process()
    return dict(form=form)


On Friday, 30 January 2015 05:23:37 UTC-6, Manuel Moscariello wrote:
>
> Hello everybody, 
> this is my first post here, I'm right now in the study phase of web2py, 
> getting pretty enthusiast about it.
> I was following a tutorial I found on a discussion of this group, 
> http://killer-web-development.com .
>
> Now, at a stage I should append to my controllers/default.py:
>
>
> def entry_post():
>     """returns a form where the can entry a post"""
>     form = crud.create(db.post)
>     return dict(form=form)
>
>
> Nothing difficoult or strange, I was still feeling confortable.
> But when I then go to mysite/myapp/default/entry_post I get a ticket with 
> a NameError:
>
> <type 'exceptions.NameError'> global name 'crud' is not defined
>
>
> I read the web2py book and crud.create(db.table) should be an accepted 
> method, so why is this error raising?
>
> Thanks you for your help, hope I am not asking a silly question but 
> neither google or a research on your group helped me.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to