Oh, you mean the db query... Here is the whole controller that's generating 
the error:

def index():
    page = int(request.vars['page']) if request.vars['page'] else 0
    items_per_page = 10
    limitby = (page*items_per_page,(page+1)*items_per_page+1)
    form = crud.update(Facturi, a0, next=URL('index'))
    facturi = db(Facturi).select(orderby=~Facturi.numar, limitby=limitby)
    today = date.today()
    return locals()

and the most important model involved looks like this:
Facturi = db.define_table('factura',
                Field('numar', notnull=True),
                Field('firma', db.firma, 
requires=IS_IN_DB(db(db.firma.request_tenant==auth.user_id), db.firma.id, 
'%(nume)s')),
                Field('cont', 'reference cont', 
requires=IS_EMPTY_OR(IS_IN_DB(db((db.cont.request_tenant==auth.user_id) & 
(db.cont.is_active==True)), db.cont.id, '%(iban)s(%(moneda)s)'))),
                Field('client', db.client, 
requires=IS_IN_DB(db(db.client.request_tenant==auth.user_id), db.client.id, 
'%(nume)s')),
                Field('platita', 'boolean', default=False),
                Field('termen_de_plata', 'date', 
default=datetime.date.today() + datetime.timedelta(15)),
                Field('moneda', requires=IS_IN_SET(('RON','EUR','USD')), 
default='RON'),
                Field('curs_schimb', 'double', default=1, 
requires=IS_FLOAT_IN_RANGE(0, 999999)),
                Field('TVA', 'integer', requires = IS_IN_SET([0,24], 
error_message=T('trebuie sa fie un TVA valid'), zero=None), default=0),
                Field('reprezentant', db.reprezentant, 
requires=IS_EMPTY_OR(IS_IN_DB(db(db.reprezentant.request_tenant==auth.user_id), 
db.reprezentant.id, '%(nume)s'))),
                Field('uuid', length=64, default=lambda:str(uuid.uuid4()), 
readable=False, writable=False),
                Field('tva_activ', 'boolean'),
                auth.signature,
                format='%(numar)s')


miercuri, 30 martie 2016, 00:25:58 UTC+3, Massimo Di Pierro a scris:
>
> I cannot tell what the query is.
>
> On Tuesday, 29 March 2016 02:06:43 UTC-5, rif wrote:
>>
>> The gae query is this:  http://11.firmoasa.appspot.com/facturi
>>
>> I have this route:
>> routers = dict(
>>
>>     # base router
>>     BASE=dict(
>>         default_application='firmoasa',
>>     ),
>> )
>>
>> And the full log is this:
>>
>> /facturi 500 952ms 0kb Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 
>> (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36 module=default 
>> version=11
>> 78.96.81.220 - - [29/Mar/2016:00:02:55 -0700] "GET /facturi HTTP/1.1" 500 
>> 378 "http://11.firmoasa.appspot.com/"; "Mozilla/5.0 (X11; Linux x86_64) 
>> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36" "
>> 11.firmoasa.appspot.com" ms=952 cpu_ms=555 cpm_usd=0.000042 
>> app_engine_release=1.9.35 instance=00c61b117c1212e7c568f7bfc458f105facfec28
>> D 2016-03-29 10:02:54.330
>> select application=firmoasa
>> D 2016-03-29 10:02:54.330
>> route: controller=facturi
>> D 2016-03-29 10:02:54.330
>> route: function.ext=index.html
>> E 2016-03-29 10:02:55.228
>>  Unable to store in FILE: 
>> /base/data/home/apps/s~firmoasa/11.391689743844727003/applications/firmoasa/controllers/facturi.py
>>
>> Traceback (most recent call last):
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/restricted.py", 
>> line 227, in restricted
>>     exec ccode in environment
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/applications/firmoasa/controllers/facturi.py",
>>  
>> line 128, in <module>
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/globals.py", 
>> line 417, in <lambda>
>>     self._caller = lambda f: f()
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/tools.py", 
>> line 4250, in f
>>     return action(*a, **b)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/applications/firmoasa/controllers/facturi.py",
>>  
>> line 9, in index
>>     form = crud.update(Facturi, a0, next=URL('index'))
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/tools.py", 
>> line 4899, in update
>>     **attributes  # contains hidden
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/sqlhtml.py", 
>> line 1295, in __init__
>>     inp = self.widgets.options.widget(field, default)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/sqlhtml.py", 
>> line 313, in widget
>>     options = requires[0].options()
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/validators.py", 
>> line 600, in options
>>     self.build_set()
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/validators.py", 
>> line 586, in build_set
>>     records = self.dbset(table).select(*fields, **dd)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/packages/dal/pydal/objects.py",
>>  
>> line 2020, in select
>>     return adapter.select(self.query, fields, attributes)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/packages/dal/pydal/adapters/google_adapters.py",
>>  
>> line 500, in select
>>     (items, tablename, fields) = self.select_raw(query,fields,attributes)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/packages/dal/pydal/adapters/google_adapters.py",
>>  
>> line 390, in select_raw
>>     filters = self.expand(query)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/packages/dal/pydal/adapters/google_adapters.py",
>>  
>> line 246, in expand
>>     return expression.op(expression.first, expression.second)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/packages/dal/pydal/adapters/google_adapters.py",
>>  
>> line 262, in AND
>>     first = self.expand(first)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/packages/dal/pydal/adapters/google_adapters.py",
>>  
>> line 246, in expand
>>     return expression.op(expression.first, expression.second)
>>   File 
>> "/base/data/home/apps/s~firmoasa/11.391689743844727003/gluon/packages/dal/pydal/adapters/google_adapters.py",
>>  
>> line 266, in AND
>>     return ndb.AND(first, second)
>>   File 
>> "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/ndb/query.py",
>>  
>> line 574, in __new__
>>     ' received a non-Node instance %r' % node)
>> TypeError: ConjunctionNode() expects Node instances as arguments; 
>> received a non-Node instance None
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to