> Before I added  format='%(product_name)s %(batch_no)s') to the product 
> table this would work,
> "update stock_task, product set withhold_until_date= 
> DATE_ADD(stock_task.completed_date, INTERVAL product.withholding_period 
> DAY)where product.product_name = stock_task.product" 
>

Are you saying you were using that raw SQL above for the update previously? 
If so, it appears in that case, your stock_task.product field was storing 
the actual value of product.product_name, not the product.id value of the 
related product record. Adding the "format" argument has nothing to do with 
this, as it doesn't affect the database model at all. Rather, it appears 
you instead changed the stock_task.product field to be a reference field, 
in which case, it is actually storing the product.id value, not the 
product.product_name value. So, in the above SQL, it would instead be 
"product.id = stock_task.product".

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