Try to do this :
class v_f_s(object):
def hmd5(self):
return md5_hash('|'.join(str(self[-1][k]) for k in
db[self[-1]]fields()))
But I get "object is unsubscriptable" error...
I don't know if it possible to add a __getitem__ to the virtual field class
that could allow me to access class item as keys so I could use them the
way I suggest up here??
Thanks
Richard
PS.: Need help for this, it is over my knowledge... :(
On Thu, Dec 15, 2011 at 1:30 PM, Richard Vézina <[email protected]
> wrote:
> Bump!
>
> Richard
>
>
> On Thu, Dec 15, 2011 at 11:56 AM, Richard <[email protected]>wrote:
>
>> Hello,
>>
>> Can I make a virtual field class generic and how?
>>
>> Here my virtual field class :
>>
>> from utils import md5_hash
>>
>> class v_f_s(object):
>> def hmd5(self):
>> return md5_hash('|'.join(str(self.test1[k]) for k in
>> db.test1.fields()))
>>
>> I would like to pass "test1" as a argument or getting it form self,
>> but since self seems to be a row I don't think I can derive tablename
>> from it??
>>
>> Thanks
>>
>> Richard
>>
>
>