>
> *INVOICE DELETING CONTROLLER*
> def deleteInvoice():
> #THE .first() FUNCTION IN THE LINE BELOW ONLY ALLOWS ME TO DELETE ITEMS 
> ONE AT A TIME
> *    query = db(db.invoice.id==request.args(0, cast=int)).select().first() 
> *
>     remove = db(db.invoice.id==query).delete()
>

Above, query is the entire Row object of a single invoice -- it is not a 
query nor an ID and does not make sense to use it as you are in the second 
line. Further, you already have the invoice ID in request.args(0), so there 
is no reason to query the DB for that record just to get its ID again.

As for "deleting all the invoice items", what do you mean by that? Do you 
want to delete all invoices in the db.invoice table? Or is there a separate 
table of invoice items that references the db.invoice table?

Anthony

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