Why is Crud deprecated and how should I have known?

131 views
Skip to first unread message

Tom Campbell

unread,
Apr 10, 2015, 11:09:01 AM4/10/15
to web...@googlegroups.com
According to this answer Crud is deprecated.

I regularly search the web2py source using this Google query:

The term does not seem to appear anywhere in the Crud source. So..

1. How should I have known?
2.  More to the point--why?

What makes this:

def new():
    crud = Crud(db)
    form = crud.create(db.todo)
    return dict(form=form)

Worse than this?

def new():
    form=SQLFORM(db.todo)
    if form.process().accepted:
            response.flash= 'Thank you.'
    elif form.errors:
            response.flash = 'Form has errors.'
    else:
            response.flash = 'Form is initialized.'
    return dict(form=form)

Anthony

unread,
Apr 10, 2015, 1:10:37 PM4/10/15
to web...@googlegroups.com
Well, the latter can now be:

form = SQLFORM(db.todo).process()

So, same as Crud.

Anthony
Reply all
Reply to author
Forward
0 new messages