The _formkey is generated by form.accepts (or form.process), so after
calling that, you can change it via:
form.formkey = 'your_hash'
Anthony
On Wednesday, December 14, 2011 12:18:48 PM UTC-5, Richard wrote:
>
> Hello Anthony,
>
> I am pretty near my goal...
>
> I can't find if I can replace SQLFORM.factory _formkey/value by my own
> hash and if so... How can I do it??
>
> I try this without success :
>
> form = SQLFORM.factory(Field('review_records', 'boolean',
> requires=IS_NOT_EMPTY()),hidden=dict(_formkey=sum_of_sum))
>
> It add a new field _formkey...
>
> Thanks
>
> Richard
>
>
> On Tue, Dec 13, 2011 at 4:38 PM, Anthony <[email protected]> wrote:
>
>> On Tuesday, December 13, 2011 4:33:38 PM UTC-5, Richard wrote:
>>>
>>> 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...
>>>
>>
>> Maybe use a virtual field, which can be applied to a join:
>> http://web2py.com/book/default/chapter/06#Virtual-Fields
>>
>>
>
>