It works on web2py - but not on GAE?
On Dec 15, 7:59 am, notabene <[email protected]> wrote:
> db.define_table('adr',
> SQLField
> ('name','string',length=32,required=True,requires=IS_NOT_EMPTY()),
>
> db.define_table('arr',
> SQLField
> ('name','string',length=32,required=True,requires=IS_NOT_EMPTY()),
> SQLField('sted','reference adr',
> default='0',required=True,requires=IS_NOT_EMPTY()),
>
> db.arr.sted.requires=IS_IN_DB(db, 'adr.id', '%(name)s')
>
> Gives the following error: (Which goes away if I change the last
> statement to
> db.arr.sted.requires=IS_IN_DB(db, 'adr.id').
>
> ERROR 2008-12-15 06:57:43,774 main.py] Traceback (most recent call
> last):
> File "/home/nb/web2py/gluon/restricted.py", line 62, in restricted
> exec ccode in environment
> File "/home/hosts/googleappengine/web2py/applications/kult/
> controllers/arr.py:opret", line 67, in <module>
> File "/home/hosts/googleappengine/web2py/gluon/globals.py", line 55,
> in <lambda>
> self._caller=lambda f: f()
> File "/home/hosts/googleappengine/web2py/applications/kult/
> controllers/arr.py:opret", line 30, in opret
> File "/home/hosts/googleappengine/web2py/applications/T3/modules/
> t2.py", line 417, in create
> showid=False,col3=col3,_class='t2-create')
> File "/home/hosts/googleappengine/web2py/gluon/sqlhtml.py", line
> 106, in __init__
> for k,v in field.requires.options():
> File "/home/hosts/googleappengine/web2py/gluon/validators.py", line
> 150, in options
> self.build_set()
> File "/home/hosts/googleappengine/web2py/gluon/validators.py", line
> 146, in build_set
> records=self.dbset.select(self.dbset._db[self.ktable].ALL,**dd)
> File "/home/hosts/googleappengine/web2py/gluon/contrib/gql.py", line
> 444, in select
> items,tablename,fields=self._select(*fields,**attributes)
> File "/home/hosts/googleappengine/web2py/gluon/contrib/gql.py", line
> 415, in _select
> orders = attributes['orderby'].name.split("|")
> AttributeError: 'str' object has no attribute 'name'
>
> On Dec 15, 6:58 am, mdipierro <[email protected]> wrote:
>
> > You can use IS_IN_DB(db,'table.id','%(otherfield1)s %(otherfield2)s
> > etc')
> > It works on GAE as on non-GAE. It does not use JOINs. Not sue if this
> > helps.
>
> > Massimo
>
> > On Dec 14, 12:53 pm, notabene <[email protected]> wrote:
>
> > > Web2py (and T2) handles references nicely with a select input-field
>
> > > Goggle AppEngine does not support joins.
>
> > > I can use IS_IN_DB - but only to select the ID
>
> > > Any suggestions on how to support the references in GAE?
>
> > > Maybe a variation of the t2.tag_widget using a select field and saving
> > > the ID?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---