Thanks Anthony, yes there were some typo's my mistakes

On Sunday, 15 November 2015 18:25:01 UTC+11, Anthony Smith wrote:
>
> Hi All,
>
> I have looking though the group for and answer on this, I am try to get 
> the product_name and batch_no from the product table to be the product in 
> the stock task table.
>
> But  getting the following traceback:
>
> Traceback (most recent call last):
>   File "/home/tony/web2py/gluon/restricted.py", line 227, in restricted
>     exec ccode in environment
>   File "/home/tony/web2py/applications/cps2d/models/db1.py" 
> <http://127.0.0.1:8000/admin/default/edit/cps2d/models/db1.py>, line 112, in 
> <module>
>     db.stock_task.product.requires=IS_IN_DB(db,db.product,lambda record: 
> format_product(record))
>   File "/home/tony/web2py/gluon/packages/dal/pydal/base.py", line 906, in 
> __getattr__
>     return super(DAL, self).__getattr__(key)
>   File "/home/tony/web2py/gluon/packages/dal/pydal/helpers/classes.py", line 
> 30, in __getattr__
>     raise AttributeError
> AttributeError
>
> Error Snapshot:
>
> <type 'exceptions.AttributeError'>()
>
>
> db.define_table('product',
>                 Field('product_name'),
>                 Field(batch_no),
>                 format=lambda record: format_product(record))
>
> def format_product(record):
>     return '%s %s' % (record.product_name, record.batch_no)
>
>
> db.define_table('stock_task',
>                 Field(........)
>                 Field(........)
>                 Field('product','list:reference products'),
>
>                 auth.signature)
>
> db.stock_task.product.requires=IS_IN_DB(db,db.product,lambda record: 
> format_product(record))
>
> any help would be great 
>
> cheers 
> 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