The code was literally just this line:

        count = db(db.static_page.id == request.args(0)).delete()

I have no idea why the sql is going without a condition, the static page 
does get deleted. I only noticed the problem because the next lines were:

        if not count:
            raise HTTP(404)

And I was constantly getting a 404.

I tested this on the command line after inserting a static page

*>>> db(db.static_page.id > 0).select().first()*
<Row {'body': '<p>vefvefv</p>', 'lang': 'pt', 'name': 'vevefv', 
'is_active': Tru
e, 'created_by': 1L, 'created_on': datetime.datetime(2014, 7, 9, 16, 8, 
51), 'mo
dified_on': datetime.datetime(2014, 7, 9, 16, 8, 51), 'modified_by': 1L, 
'id': 1
L}>
*>>> count = db(db.static_page.id == 1).delete()*
*>>> count*
0
*>>> db(db.static_page.id > 0).select().first()*
*>>>*

So as you can see it's returning zero when in fact it's deleting one 
record, as one can see in the final query that nothing is returned.

-- 
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