Yeh, that's what I ended up doing.  Since I am very new to web2py,
couldn't figure it out, I did this in the View layer.  I would prefer
to do it at the controller, as you have done. Thanks for the help.

On Sep 12, 11:30 pm, mdipierro <[email protected]> wrote:
> You are doing many2many using tagging. It works on GAE.
> The problem is that the particular query you are want to make does not
> work on GAE.
>
> It would be
>
> rows=db(db.Project.developers.like('|1|')).select()
>
> but "LIKE" is nor supported on GAE.
>
> I suggest you select all rows (if less than 1000) and then filter them
>
> rows=db(db.Project.id>0).select()
> rows=[row for row in rows if row.developers.find('|1|')>=0]
>
> On Sep 12, 7:24 pm, konsumer <[email protected]> wrote:
>
>
>
> > Hi, I have a couple many-to-many relationship, defined like this:
>
> > auth.settings.table_user = db.define_table(
> >     auth.settings.table_user_name,
> >     Field('first_name', length=128,default=''),
> >     Field('last_name', length=128,default=''),
> >     Field('email', length=128,default='', requires = [IS_EMAIL(),
> > IS_NOT_IN_DB(db,'%s.email' % auth.settings.table_user_name)]),
> >     Field('password', 'password', readable=False, label='Password',
> > requires=CRYPT()),
> >     Field('registration_key', length=128, writable=False,
> > readable=False, default=''),
> >     Field("shortname","string",length=32),
> >     Field("picture","upload"),
> >     Field("job_title","string"),
> >     Field("description","text"),
> >     Field("portfolio_text","text"),
> > )
>
> > db.define_table("Technology",
> >     Field("name","string",length=100),
> > )
>
> > db.define_table("Project",
> >     Field("name",'string',length=100),
> >     Field("description",'text'),
> >     Field("image",'upload'),
> >     Field("developers", 'string'),
> >     Field("technologies",'string'),
> > )
>
> > db.Project.developers.requires=IS_IN_DB(db, "%s.id" %
> > auth.settings.table_user_name, "%s.shortname" %
> > auth.settings.table_user_name, multiple=True)
> > db.Project.technologies.requires=IS_IN_DB(db, "Technology.id",
> > "Technology.name", multiple=True)
>
> > How do I select Projects that have a certain developer? (for example,
> > if Project.developers='|1|2|3|', and I want to find all that have
> > developer 1, it should return that row)
>
> > Is this possible on GAE?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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