>
> Can "default" be equal to a variable dependent on another field in the 
> same table?
>

I haven't looked at your original question in detail, but regarding the 
above question about defaults, no, they can't be dependent on other fields 
in the same table (though they can be dependent on request.vars, including 
request.vars that have been submitted to fill other fields in the table). 
An alternative is to set the "compute" attribute of the field, which can 
(and is intended to) depend on other fields in the table (see 
http://web2py.com/books/default/chapter/29/6#Computed-fields). You can 
insert a value directly into the field, but if no value is provided, it 
will compute a value according to the compute function. Note, by default 
computed fields are not shown in SQLFORMs, though you can explicitly list 
them among the fields to be shown.

Anthony 

Reply via email to