Try this:
db.reg_registry.registry_id.requires =
IS_IN_DB(db,'reg_registry.registry_id',lambda row: '%s-%s-%s' %
(row.num_part1.rstrip(),row.num_part2.rstrip(),
row.num_part3.rstrip()) )

'%(num_part1)s-%(num_part2)s-%(num_p art3)s'
On Jun 16, 12:33 pm, Jean-Guy <[email protected]> wrote:
> Hello,
>
> I use %()s in a IS_IN_DB validator like this :
>
> db.reg_registry.registry_id.requires =
> IS_IN_DB(db,'reg_registry.registry_id','%(num_part1)s-%(num_part2)s-%(num_p 
> art3)s')
>
> return
>
> num_part1 -num_part2 -num_part3
>
> My problem is that %()s seems to add whitespace at the end of the string
> what I don't want...
>
> What I want :
>
> num_part1-num_part2-num_part3
>
> I try with rstrip() but can't figure how to make it works.
>
> Thanks.
>
> Jonhy

Reply via email to