in case, somebody want to use before delete callback with auth.signature
and record versioning, please see this thread :
https://groups.google.com/forum/#!topic/web2py/sp4fpYz36HI
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
please. we can't continue to feed you the exact bugfix for your own
application. start with a small model, print what is passed back and
adjust accordingly. Then extend to the more complex model and see what is
the addition breaking. There are no limitations whatsoever
Il giorno lunedì 16
i found the root cause, it related with auth.signature
imho, the limitation for using before and after callback, it's not work
when using auth.signature.
e.g. 1
in models/db.py
*not work*
from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db)
crud, service, plugins
sorry, my bad. The Set is indeed not a Query ...
def __ondelete_receipt_order(s):
receipt_order = s.select().first()
db(db.purchase_order_header.id==receipt_order.purchase_order_no).update(status='Purchase
Order Authorized')
i've followed your hints, but still not worked (no error occured).
def __ondelete_receipt(s):
purchase_order_no=s.select().first().purchase_order_no
# for test # purchase_order_no=s.select()[0].purchase_order_no
db(db.purchase_order_header.id==purchase_order_no).update(status='Purchase
Order
my solution works, I tested it :D
On Sunday, September 15, 2013 2:30:06 PM UTC+2, 黄祥 wrote:
i've followed your hints, but still not worked (no error occured).
def __ondelete_receipt(s):
purchase_order_no=s.select().first().purchase_order_no
# for test #
yeah, you are right, your solution is work, i've tested it with the new
app, with the simple tables (only 2) and it work well, thank you so much,
but in my application that more complex it doesn't work.
i've already commenting my code that maybe affect the table in the model
(something like,
the ondelete doesn't receive a single record: it receives the set that is
going to be deleted (remember, one can drop a whole bunch of rows with a
single delete())
i.e. when you fire db(cond).delete(), cond is passed.
If I understand what you're trying to do, you need to fetch the
yeah, my goal is when i delete receipt order it will update the purchase
order status.
i've followed your suggestion, but still not update the status of purchase
order when i delete the receipt order (no error occured, just not update
the purchase order).
def __ondelete_receipt_order(s):
9 matches
Mail list logo