Comments (8)
From [email protected] on October 15, 2012 05:44:43
Status: Accepted
from web2py.
From [email protected] on October 15, 2012 06:37:48
Just confirming that the problem persists in 2.1.1 (as expected since it came out just a few minutes after this bug report).
Also I forgot to mention that the steps to reproduce build on the admin "new simple app" skeleton.
from web2py.
From [email protected] on October 15, 2012 07:02:19
I acknowledge this happens but if the reference tables are lazy that means they are not defined unless explicitly called. There is no way for the grid to know about them. Try:
def index2():
db.y, db.z
return dict(grid=SQLFORM.smartgrid(db.x))
or
def index2():
return dict(grid=SQLFORM.smartgrid((db.x,db.y,db.z)))
from web2py.
From [email protected] on October 15, 2012 07:34:00
The first method indeed works. However, in this example there are only 2 referencing tables, there are projects where there are quite a lot more and it's tiresome to have to refer to all of them before calling smartgrid, when the grid is supposed to be smart about this.
This also makes it impossible to use lazy_tables with functions that require introspection of the database schema. I don't have any great solutions apart from this kind of functions somehow (maybe raising an exception) forcing a rebuild of the request environment, with lazy_tables=False. Which hopefully shouldn't make them much slower since lazy is so much faster anyway.
Either way, thanks for the workaround.
from web2py.
From [email protected] on October 16, 2012 08:41:10
Do you get a performance benefit from the lazy_tables?
from web2py.
From [email protected] on October 16, 2012 08:55:37
I frankly haven't measured yet, I've only recently started using web2py, and the website I got this problem in (I used smartgrid quite a lot in the backend), isn't in the production phase yet. I'm guessing yes at this time because most frontend pages only use a small portion of the tables but it's really just a guess. At this time I'm still only testing it for bugs and not for performance yet.
I guess I could put the backend in a different app using the same database, that used lazy_tables=False in the model, that might be the best solution in this kind of scenario.
from web2py.
not sure if this will ever be solvable. @leonelcamara : do you still feel the need for this "feature" ?
from web2py.
going to close this unless @leonelcamara chimes in in the next week.
I stand by the "original chicken-egg issue" that if you want lazy_tables you can't expect smartgrid to roll-out every possible linked table without - for all intents and purposes - unlazying all tables.
from web2py.
Related Issues (20)
- Admin application fails on Python 3.10 in version 2.23.0 HOT 2
- SSLv3 unknown certificate
- web2py 2.23.0 is giving a 403 error when I try to package my applications
- SECURITY: JQuery 1.2 < 3.5.0 Multiple XSS
- Scheduler does not exit on OperationalError HOT 9
- Lack of checking if the supplied value is numerical in SQLFORM.grid search function HOT 2
- scheduler.py AttributeError: '_thread._local' object has no attribute '_scheduler'
- SECURITY: Vulnerable to HTTP Response Splitting
- Error when searching with SQLFORM.grid with order field selected HOT 1
- Add to book recipie? - How to host web2py with python3 on cpanel server
- blank admin
- Circular import
- About Sessions Storage
- web2py does not work with Python 3.12 HOT 3
- The new version (2.27.1) does not work for me HOT 1
- SECURITY.md contains no email contact
- db.export_to_csv_file does not correctly back up a database with record versioning enabled. HOT 2
- web2Py admin pages cant be opened when the webserver is behind a (reverse) proxy Server
- pydal 20240427 breaks gluon/login HOT 1
- Record versioning blocks update occasionally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web2py.