--
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 web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It sounds like instead, you would prefer for the module to create a table object so the table object can be imported directly (and then added to the DAL connection object of the current request) -- that way, the table object would be created only once, the first time it is imported.
It sounds like instead, you would prefer for the module to create a table object so the table object can be imported directly (and then added to the DAL connection object of the current request) -- that way, the table object would be created only once, the first time it is imported.
Of course, the problem with this approach is that you couldn't dynamically change any attributes of the table or its fields (e.g., .readable and .writable) at request time, because that would effect other requests as well.
I don't know that needing to define a per-request readable/writable is such a common use-case - or else I don't fully understand what you are alluding to...
If so, I guess they would have to be re-set automatically by the DAL object on each request,
In most ORMs/DALs there is a clear separation between the connection-object and the schema-object(s), and for good reason : schema-changes are few and far between - requests/connections are numerous and rapid - it makes no sense tying them together like that... It's a poor design-choice, IMHO.
--
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/WR6RAMRQesg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
I am trying to shave-off the needless DDL model definition in each request - when you have hundreds of tables with (cumulatively) thousands of fields,
--
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 web2py+un...@googlegroups.com.
--
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/WR6RAMRQesg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
is conditional models is same like response.models_to_run()? because i searched in this form related with conditional models,
another thing is, how about the performance according to put the models into modules and response.models_to_run()? which is better?
if request.controller in ['controller1', 'controller2', 'controller3']:
response.models_to_run = ['path/to/modelA.py', 'path/to/modelB.py']
from gluon import Field
def mymodels(db):
db.define_table('table1', Field('field1'), Field('field2'))
db.define_table('table2', Field('field1'), Field('field2'))from mymodule import mymodels
mymodels(db)if request.controller == 'appadmin':
[code to import and define all models]