On Wednesday, June 20, 2018 at 9:16:04 AM UTC-4, Ayron Rangel wrote:
>
> Anthony,
>
> What I want would be to insert the same value(integer) from one Field to
> another Field on other table.
> Ex.:
>
> db.define_table('product',
> Field('name', 'string'),
> Field('qtd', 'integer', default
Anthony,
What I want would be to insert the same value(integer) from one Field to
another Field on other table.
Ex.:
db.define_table('product',
Field('name', 'string'),
Field('qtd', 'integer', default=1, readable=False, writable=False),
Field('stock_id', db.stock)
)
db.define_table
This is generally not good database design. What are you really trying to
do? Would it make more sense for mytable2 to reference mytable?
Anthony
On Tuesday, June 19, 2018 at 9:09:42 PM UTC-4, Ayron Rangel wrote:
>
> How can i save the value of one field in another table field??
>
> db.define_ta
perhaps you can use database callbacks or form validation
*ref:*
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update
http://web2py.com/books/default/chapter/29/07/forms-and-validators#onvalidation
best regards,
stifan
--
Reso
4 matches
Mail list logo