Note that there are some explanatory texts on larger screens.

plurals
  1. POWeb2py Rating Widget (5 of them and in the same line)
    text
    copied!<p>I have a new problem. </p> <p>I already done my widget but now i want 5 rating widget's for 5 categories in my database.</p> <p>I have this column in my database (named places.categ):</p> <pre><code>places.categ a b c d a e .... </code></pre> <p>I have 21 markers in my Google Maps and each one of them as a category. (a,b,c,d or e).</p> <p>How can i associate 5 rating widgets to those 21 markers by category? All i could do was this:</p> <pre><code>db.define_table('product', Field('A', 'integer',requires=IS_IN_SET(range(1,6))), Field('B', 'integer',requires=IS_IN_SET(range(1,6))), Field('C', 'integer',requires=IS_IN_SET(range(1,6))), Field('D', 'integer',requires=IS_IN_SET(range(1,6))), Field('E', 'integer',requires=IS_IN_SET(range(1,6)))) </code></pre> <p>I have this code in my models/db.py and this one in my controllers/default.py:</p> <pre><code>from plugin_rating_widget import RatingWidget # Inject the widgets db.product.A.widget = RatingWidget() db.product.B.widget = RatingWidget() db.product.C.widget = RatingWidget() db.product.D.widget = RatingWidget() db.product.E.widget = RatingWidget() # form2 = SQLFORM.factory( # Field('Rating','integer',widget=SQLFORM.widgets.RatingWidget)) # if form2.process().accepted: # print form2.vars.search form2 = SQLFORM(db.product) if form2.accepts(request.vars, session): session.flash = 'submitted %s' % form2.vars redirect(URL('index')) </code></pre> <p>I have 5 rating widget but they are not associated to my database and they are vertical (in 5 lines) and not in 1 line, like i wanted too.</p> <p>TIA.</p> <p>P.S.: I have the plugin rating widget uploaded.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload