I fixed it with a custom validator as howesc suggested.Basically i
added a second set parameter which has the selected items of other
products, without changing the items that the widget will use, but
affecting the final values variable used for persistence:
class CUSTOM_IS_IN_DB(Validator):
de
yes, shouldn't be "what already exists in db" because that may include
items of the actual selection. DOing the multiselect only useful for
adding stuff... but the actual selection + what was already selected
from the other products.
I'll see if I find a way to do that.
Thanks,
Nico
On Sat, Jul 3
sounds like you would need to write either a custom validator and or some
custom handling of the form - the SQLFORM() helper assumes that what is the
output of the validated field is exactly what you want to store in the DB,
but it sounds like you want the output of the validated field to be mad
Please is theare any chance to do this? without having to go for the 3
tables apporach?
To remind you all:
I have a multiselect like this one:
db.py:
db.define_table('instance',Field('app',db.application),Field('server',db.server),Field('type','string'),format=lambda
r: '%s %s' %(db.application[r
any ideas?
I'm currently having a problem with this validation:
db.audienceInstances.instances.requires=IS_IN_DB(db(db.instance.type==auth.user.product),
'instance.id',db.instance._format,multiple=True)
If the user changes the profile to other product and susbscribe to
instances shown for that product, the p
works perfect. Thanks!
On Friday, July 15, 2011 12:27:19 PM UTC-4, Anthony wrote:
>
> The table format string/function should be stored in its ._format
> attribute, so you might also be able to do:
>
> db.audienceInstances.instances.requires=IS_IN_DB(db(db.instance.type==auth.user.product),
>
> 'instance.id',db.ins
The table format string/function should be stored in its ._format attribute,
so you might also be able to do:
db.audienceInstances.instances.requires=IS_IN_DB(db(db.instance.type==auth.user.product),
'instance.id',db.instance._format,multiple=True)
Maybe that should actually be the default
I fixed it like this:
db.audienceInstances.instances.requires=IS_IN_DB(db(db.instance.type==auth.user.product),'instance.id',lambda
r: '%s %s' %
(db.application[r.app].name,db.server[r.server].hostname),multiple=True)
On Fri, Jul 15, 2011 at 2:52 PM, Nicolas Palumbo wrote:
> Although this i
Although this is working:
db.audienceInstances.instances.requires=IS_IN_DB(db(db.instance.type==auth.user.product),'instance.id',multiple=True)
Is only showing ids , disregarding of the format defined here:
db.define_table('instance',Field('app',db.application),Field('server',db.server),Fiel
The default validator for a list:reference field is
IS_IN_DB(db,'.id',multiple=True). Instead of db, you can pass a DAL
Set to that validator to filter the returned list -- something like:
db.audienceInstances.instances.requires=IS_IN_DB(db(db.instance.type==current_profile.type),'instance.id',
any alternatives?
On Wed, Jul 13, 2011 at 3:39 PM, Nicolas Palumbo wrote:
> I have currently this multiselect generated by list:references:
>
> db.py:
>
> db.define_table('instance',Field('app',db.application),Field('server',db.server),Field('type','string'),format=lambda
> r: '%s %s' %(db.applic
13 matches
Mail list logo