Colour Picker widget for web2py displays multiple -


i have installed color picker widget web2py.

i trying use multiple color pickers in single form , getting unwanted repeats of widget - 10 on page instead of 4.

here table definition model.py

db.define_table('config',     field('width', 'decimal(10,6)'),     field('height', 'decimal(10,6)'),     field('plot_color_1', 'string', widget=color_widget.widget),     field('plot_color_2', 'string', widget=color_widget.widget),     field('plot_color_3', 'string', widget=color_widget.widget),     field('plot_color_4', 'string', widget=color_widget.widget),     auth.signature,     migrate=true, ) 

here controller, config.py

def edit():     record = db.config(1)     fields = (         db.config.id,         db.config.width,         db.config.height,         )     form = sqlform(db.config, record,          #fields=fields,          showid=false)     if form.process().accepted:         response.flash = 'form accepted'     elif form.errors:         response.flash = 'form has errors'     else:         response.flash = 'please fill out form'     return dict(form=form) 

and resulting output.

enter image description here

can suggest workaround?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -