Is it some additional file? I can't find JS/jQuery folder in web2py installation version.
On 22 Wrz, 15:31, mdipierro <[email protected]> wrote: > in JS/jQuery if the request.vars.no_1 matckesform.record.no_1 change > the jQuery('#no_1').attr('background-color','red') > > On Sep 22, 1:24 am, elfuego1 <[email protected]> wrote: > > > Is there a way to display matching values or fields with matching > > values in different color? > > For example: red > > > I was thinking on doing this via css but don't know how to verify that > > for instance: one or two - particular values - out of 4 (fromsearch > >form) matched those in DB. > > > On 22 Wrz, 06:18, mdipierro <[email protected]> wrote: > > > > replace > > > > s=[int(form.vars['no_%i'%i]) for i in keys ifform.vars['no_ > > > %i'%i]!=None] > > > query=reduce(lambda a,b:a|b,[db.numbers['no_%i'%i].belongs(s) > > > for i in keys]) > > > > with > > > > query=reduce(lambda a,b:a&b,[db.numbers['no_ > > > %i'%i]==form.vars['no_%i'%i]) > > > for i in keys]) > > > > On Sep 21, 8:35 pm, elfuego1 <[email protected]> wrote: > > > > > Thank you Massimo!!! > > > > > It works on my end as well! ;-) > > > > > Could you yet tell me how to modify query part, if I'd like to have > > > > results shown ONLY, if the numbers are in exactly the same order as > > > > they are stored in DB? > > > > > no_1 == db.numbers['no_1'] & > > > > no_2 == db.numbers['no_2'] & > > > > no_3 == db.numbers['no_3'] & > > > > no_4 == db.numbers['no_4'] > > > > > Is there a way to display matching values or fields with matching > > > > values in different color? > > > > For example: red > > > > > On 21 Wrz, 17:11, mdipierro <[email protected]> wrote: > > > > > > Model: > > > > > > db.define_table('numbers', > > > > > Field('no_1', 'integer', > > > > > requires=IS_INT_IN_RANGE(0,10000)), > > > > > Field('no_2', 'integer', > > > > > requires=IS_INT_IN_RANGE(0,10000)), > > > > > Field('no_3', 'integer', > > > > > requires=IS_INT_IN_RANGE(0,10000)), > > > > > Field('no_4', 'integer', > > > > > requires=IS_INT_IN_RANGE(0,10000)), > > > > > Field('date', 'date')) > > > > > > Controller: > > > > > > defsearch(): > > > > > form=SQLFORM.factory( > > > > > Field('no_1','integer',label="No 1"), > > > > > Field('no_2','integer',label="No 2"), > > > > > Field('no_3','integer',label="No 3"), > > > > > Field('no_4','integer',label="No 4")) > > > > > ifform.accepts(request.vars,keepvalues=True): > > > > > keys=(1,2,3,4) > > > > > s=[int(form.vars['no_%i'%i]) for i in keys ifform.vars['no_ > > > > > %i'%i]!=None] > > > > > query=reduce(lambda a,b:a|b,[db.numbers['no_%i'%i].belongs(s) > > > > > for i in keys]) > > > > > items=db(query).select() > > > > > if not items: response.flash="There are no matching records in > > > > > Database." > > > > > else: > > > > > items=[] > > > > > return dict(form=form,items=items) > > > > > > View: default/search.html > > > > > > {{extend 'layout.html'}} > > > > > {{=form}} > > > > > {{=SQLTABLE(items,headers="fieldname:capitalize") if items else > > > > > "Nothing to see here."}} > > > > > > This works for me. > > > > > > On Sep 21, 9:21 am, elfuego1 <[email protected]> wrote: > > > > > > > Hello, > > > > > > > Did you manage to find a cause of the problem? > > > > > > Why the dbsearchis not working? > > > > > > > Best wishes, > > > > > > > On 19 Wrz, 18:26, mdipierro <[email protected]> wrote: > > > > > > > > My office email server appears to be done. Maintenance perhaps. > > > > > > > > On Sep 19, 11:13 am, elfuego1 <[email protected]> wrote: > > > > > > > > > Ok. I've sent it again. > > > > > > > > Should be there right now. > > > > > > > > > On 19 Wrz, 16:42, mdipierro <[email protected]> wrote: > > > > > > > > > > nope > > > > > > > > > > On Sep 19, 4:52 am, elfuego1 <[email protected]> wrote: > > > > > > > > > > > Has my message reached your e-mail? > > > > > > > > > > The email topic: "Simplesearchform" > > > > > > > > > > > On 17 Wrz, 23:37, elfuego1 <[email protected]> wrote: > > > > > > > > > > > > I did as you suggested. > > > > > > > > > > > The mail should be in your mail box. > > > > > > > > > > > > On 17 Wrz, 15:55, mdipierro <[email protected]> > > > > > > > > > > > wrote: > > > > > > > > > > > > > You need to help some bore with debugging. Looks to me > > > > > > > > > > > > there simply is > > > > > > > > > > > > no matching data. > > > > > > > > > > > > Trysearchby one single filed, Try print the values > > > > > > > > > > > > ofform.vars. > > > > > > > > > > > > > or send me the app and I will take a look. > > > > > > > > > > > > > On Sep 17, 8:47 am, elfuego1 <[email protected]> wrote: > > > > > > > > > > > > > > OK. Both parts are there in the view. > > > > > > > > > > > > > The input fields are not evaluated against Database > > > > > > > > > > > > > though. > > > > > > > > > > > > > Even if I enter numbers that are there in > > > > > > > > > > > > > DB,formresponses with: > > > > > > > > > > > > > "There are no matching records in Database." > > > > > > > > > > > > > > If the numbers are matching they should be displayed > > > > > > > > > > > > > in the result > > > > > > > > > > > > > part of thesearchpage. > > > > > > > > > > > > > > I tried something like this aslo: > > > > > > > > > > > > > > items=db(db.numbers.no_1==form.vars.no_1|\ > > > > > > > > > > > > > db.numbers.no_2==form.vars.no_2|\ > > > > > > > > > > > > > db.numbers.no_3==form.vars.no_3|\ > > > > > > > > > > > > > db.numbers.no_4==form.vars.no_4).select() > > > > > > > > > > > > > > But it's not working either. > > > > > > > > > > > > > > Can I count on some hint? > > > > > > > > > > > > > > Best wishes. > > > > > > > > > > > > > > On 16 Wrz, 23:19, mdipierro <[email protected]> > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > somewhere you still have in it > > > > > > > > > > > > > > > {{=SQLTABLE(items,headers="fieldname:capitalize")}} > > > > > > > > > > > > > > > which as we said only works {{if items:}} > > > > > > > > > > > > > > > Please remove everything from the view. > > > > > > > > > > > > > > You should just have > > > > > > > > > > > > > > > {{extend 'layout.html'}} > > > > > > > > > > > > > > {{=form}} > > > > > > > > > > > > > > {{=SQLTABLE(items,headers="fieldname:capitalize") > > > > > > > > > > > > > > if items else > > > > > > > > > > > > > > "nothing to see here"}} > > > > > > > > > > > > > > > On Sep 16, 4:15 pm, elfuego1 <[email protected]> > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > OK. Both parts are there in the view. > > > > > > > > > > > > > > > > Now, when I go from index.html tosearch.html I > > > > > > > > > > > > > > > get an error: > > > > > > > > > > > > > > > > Traceback (most recent call last): > > > > > > > > > > > > > > > File "gluon/restricted.py", line 188, in > > > > > > > > > > > > > > > restricted > > > > > > > > > > > > > > > File > > > > > > > > > > > > > > > "F:\Programy\web2py\applications\myapp/views\default/ > > > > > > > > > > > > > > >search.html", line 88, in <module> > > > > > > > > > > > > > > > File "gluon/sqlhtml.py", line 1192, in __init__ > > > > > > > > > > > > > > > AttributeError: 'list' object has no attribute > > > > > > > > > > > > > > > 'colnames' > > > > > > > > > > > > > > > > Line 88: > > > > > > > > > > > > > > > response.write(SQLTABLE(items,headers="fieldname:capitalize")) > > > > > > > > > > > > > > > > On 16 Wrz, 22:02, mdipierro > > > > > > > > > > > > > > > <[email protected]> wrote: > > > > > > > > > > > > > > > > > You have aform: > > > > > > > > > > > > > > > > > defsearch(): > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > form=SQLFORM.factory(INPUT('no_1','integer'), > > > > > > > > > > > > > > > > <= line 57 > > > > > > > > > > > > > > > > INPUT('no_2','integer'), > > > > > > > > > > > > > > > > INPUT('no_3','integer'), > > > > > > > > > > > > > > > > INPUT('no_4','integer')) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ifform.accepts(request.vars,keepvalues=True): > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > items=db(db.numbers.no_1.contains(form.vars.no_1)|\ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > db.numbers.no_2.contains(form.vars.no_2)|\ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > db.numbers.no_3.contains(form.vars.no_3)|\ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > db.numbers.no_4.contains(form.vars.no_4)).select() > > > > > > > > > > > > > > > > else: items=[] > > > > > > > > > > > > > > > > return dict(form=form,items=items) > > > > > > > > > > > > > > > > > you need to but both > > > > > > > > > > > > > > > > > {{=form}} > > > > > > > > > > > > > > > > > and > > > > > > > > > > > > > > > > > {{=SQLTABLE(items,headers="fieldname:capitalize") > > > > > > > > > > > > > > > > if items else > > > > > > > > > > > > > > > > "nothing to see here"}} > > > > > > > > > > > > > > > > > in the view > > > > > > > > > > > > > > > > > On Sep 16, 2:25 pm, elfuego1 > > > > > > > > > > > > > > > > <[email protected]> wrote: > > > > > > > > > > > > > > > > > > I did as you told me. Now I don't > > > > > > > > > > > > > > > > > havesearchformon mysearchpage. > > > > > > > > > > > > > > > > > What do you mean by saying: >>it is only > > > > > > > > > > > > > > > > > producing "nothing to see > > > > > > > > > > > > > > > > > here" > > > > > > > > > > > > > > > > > because there is no data.<< > > > > > > > > > > > > > > > > > There is data in DB waiting to be searched, > > > > > > > > > > > > > > > > > but how am I supposed to > > > > > > > > > > > > > > > > > do that now when there is no input fields > > > > > > > > > > > > > > > > > onsearchpage?! > > > > > > > > > > > > > > > > > How do I get input fields and results for > > > > > > > > > > > > > > > > > mysearchbelow? > > > > > > > > > > > > > > > > > > This is some vicious circle... > > > > > > > > > > > > > > > > > > On 16 Wrz, 02:47, mdipierro > > > > > > > > > > > > > > > > > <[email protected]> wrote: > > > > > > > > > > > > > > > > > > > It is working just not being called. The > > > > > > > > > > > > > > > > > > output you see comes from > > > > > > > > > > > > > > > > > > this code you have > > > > > > > > > > > > > > > > > > > {try:}}{{=H2(message)}}{{except:}}{{=BEAUTIFY(response._vars)}} > > > > > > > > > > > > > > > > > > {{pass}} > > > > > > > > > > > > > > > > > > > and you should remove it. > > > > > > > > > > > > > > > > > > > The code I suggested: > > > > > > > > > > > > > > > > > > > {{=SQLTABLE(items,headers="fieldname:capitalize") > > > > > > > > > > > > > > > > > > if items else > > ... > > więcej >>

