Hello Anthony,

Since my "row" come from a query may I can do something like this (pseudo
code) :

rows = db((db.lotns_lot_number.id == request.args(1))&\
        (db.lotns_sample.lot_number_id == db.lotns_lot_number.id)&\
        (db[request.args(0)].sample_id ==
db.lotns_sample.sample_id)).select\
        (db[request.args(0)].ALL, *HASH_FUNC(db[request.args(0)].ALL)*
 orderby=db.lotns_sample.sample_code)


In SQL it is pretty common to use Alias for computed field on the fly... I
just don't know if web2py can handle it that way...

Thanks

Richard

On Tue, Dec 13, 2011 at 4:05 PM, Anthony <[email protected]> wrote:

> What I would like to have that is not actually possible I think is a way
>> to "detect_record_change" with SQLFORM.factory...
>>
>> Do you have any idea how I could achieve that?
>>
>
> You could create a hash of each row and store the hash value in a hidden
> field. Then on form submission, hash the current version of the same row,
> and make sure it matches the hash in the hidden field of the submitted form
> -- if not, the record changed in between form creation and submission.
> Actually, rather than creating a separate hidden field, you could even set
> the record hash as the form's _formkey value (which is what
> 'detect_record_change' actually does).
>
> Anthony
>

Reply via email to