what if you are searching for records that have leading or training
spaces? (perhaps inserted by mistake)

On Oct 12, 5:42 am, vihang <[EMAIL PROTECTED]> wrote:
> just checked.. the search works fine now in t2,
>
> one more thing, the input box value would do well with .strip() added
> to remove whitespaces... they are definitely a problem with the
> search.. but I was just wondering that would it be useful if its added
> to the framework... I cannot think of any instance where I would want
> a starting and trailing whitespaces when I capture a value from the
> form... maybe others may have something to say.
>
> On Oct 8, 8:25 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > I made a mistake and you have discovered something important.
>
> >      a and b
>
> > it not the same as
>
> >      a & b
>
> > queries you use '&', not 'and'. Example:>>> class A():
>
> > ...      def __and__(self,other): print 'and'
> > ...>>> a=A()
> > >>> b=A()
> > >>> a and b
>
> > <__main__.A instance at 0xa8c60>>>> a & b
>
> > and
>
> > the operator __and__ overloaded in the DAL is '&', not 'and'.
>
> > This means there is an error in theT2example.
>
> > Massimo
>
> > On Oct 8, 3:58 am, vihang <[EMAIL PROTECTED]> wrote:
>
> > > for unknown reasons, the query suggested in thet2examples did not
> > > work.
>
> > > listing_own=db.t2_person.id==db.listing_owner.person_id and
> > > db.Accomodation.id==db.listing_owner.Accomodation_id
>
> > > This is how it works
>
> > > listing_own=(db.t2_person.id==db.listing_owner.person_id) &
> > > (db.Accomodation.id==db.listing_owner.Accomodation_id)
>
> > > Vihang
>
> > > On Oct 6, 2:35 am, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > > > I will run some tests later tonight. Thanks for letting me know.
>
> > > > Massimo
>
> > > > On Oct 5, 12:24 pm, vihang <[EMAIL PROTECTED]> wrote:
>
> > > > > Thesearchfunction is not processing the query. I am yet to probe
> > > > > into this.
>
> > > > > Here's the issue
>
> > > > > in model
> > > > > db.define_table('listing_owner',
> > > > >     SQLField('person_id',db.t2_person),
> > > > >     SQLField('Accomodation_id',db.Accomodation))
>
> > > > > listing_own=db.t2_person.id==db.listing_owner.person_id and
> > > > > db.Accomodation.id==db.listing_owner.Accomodation_id
>
> > > > > in controller
> > > > >search=t2.search(db.t2_person,db.Accomodation, query=listing_own)
>
> > > > > result
>
> > > > > I get the combination of all the t2_person with Accomodation_id
>
> > > > > Any clue?
>
> > > > > Vihang
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to