standard_characters = db( db.Characterz.Characterz_IsStandard == 1 ).select( db.Characterz.id, db.Characterz.Characterz_NameLOL)
Use your own field names as key in col3. On Dec 14, 8:09 pm, Shel <[email protected]> wrote: > For my first question, I ended up doing: > > standard_characters=db.executesql("Select Characterz.id, > Characterz_NameLOL from Characterz where > Characterz.Characterz_IsStandard=1") > db.Story.Char_ID_Player.requires = IS_IN_SET(standard_characters, > '%(Characterz_NameLOL)s') > > Which appears to work. It seems like it should be fairly > straightforward to translate this into Web2Py's query syntax. > > I am still not able to see col3 in my form though, despite playing > with the 'formstyle' parameter. > > On Dec 14, 3:30 pm, Shel <[email protected]> wrote: > > > I have been searching for answers to a couple of questions, but > > nothing I have tried has worked so far. Any help or advice would be > > appreciated. > > > Q1 - I have a dropdown in an SQLFORM that shows a list of character > > names based on the model in Db.Py (db.Story.Char_ID_Player.requires = > > IS_IN_DB(db, db.Characterz.id, '%(Characterz_NameLOL)s') > > > I would like to limit this dropdown so that it only contains rows > > where the field Characterz.Characterz_IsStandard == Is there a way to > > do this? > > > ******* > > > Q2 - I am trying to experiment with "col3" in my SQLFORM, using a > > modified version of the example in the book, but I don't see the third > > column in my form for some reason. The rest of the form looks fine. > > My form definition in the controller looks like: > > > form = SQLFORM(db.Story, > > fields=['Char_ID_Player', 'Story_Name', 'Story_MagicWord'], > > labels={'Char_ID_Player':'Pick a karakturr', 'Story_Name':'Enter > > ur story name', 'Story_MagicWord':'Enter ur majik wurd'}, > > comments=True, > > col3 = {'name':A('what is this?', _href='http://www.google.com/ > > search?q=define:name')}, > > submit_button='Kthx') > >

