have you defined the table? web2py 2.4.* is really old. I suggest upgrading to a newer version
Paolo 2015-05-14 10:16 GMT+02:00 goome <[email protected]>: > from the shell i tried > > legacy_db = DAL('sqlite://rocketdb') > # it found the db > fornitori = > legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) > > stille give error > AttributeError: 'DAL' object has no attribute 'fornitori' > > but now this is working calles from the server .... > ?? > > > Il giorno giovedì 14 maggio 2015 09:38:33 UTC+2, goome ha scritto: >> >> 2.4.6 stable >> No, i cannot reproduce because today when i open the browser it worked! >> By the way, what is the correct way load the models in the shell? >> i open the shell with >> python web2py -S myapplic >> lanched from the dir of web2py, so that myapplic in under appilcations/ >> >> >> >> Il giorno mercoledì 13 maggio 2015 21:14:27 UTC+2, Paolo Valleri ha >> scritto: >>> >>> Which web2py version are you using? >>> Can you post a complete example that reproduces the issue? >>> >>> Paolo >>> >>> On Wednesday, May 13, 2015 at 7:14:30 PM UTC+2, goome wrote: >>>> >>>> hello , i have this action in defaul.py >>>> """ >>>> @auth.requires_login() >>>> def lista_fornitori(): >>>> fornitori = >>>> legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) >>>> return dict(fornitori = fornitori) >>>> "" >>>> and this work perfectly giving me the list of records in table >>>> 'fornitori' >>>> >>>> Now in another action i need to retrieve the same list for creating a >>>> select, >>>> but this time the same code >>>> fornitori = legacy_db().select(legacy_db.fornitori.ALL) >>>> fails with error >>>> AttributeError: 'DAL' object has no attribute 'fornitori' >>>> >>>> why in this action DAL does not find the table fornitori? What could be >>>> the problem. >>>> The 2 actions are both in default.py >>>> >>>> The beginning of thje second actions: >>>> def sel_fornitore(): >>>> fornitori = legacy_db(legacy_db.fornitori.ALL).select() >>>> >>>> i also tried from shell with the same error. >>>> What i am missing? >>>> >>>> -- > 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 a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/B-Nqj2CKS-0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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.

