Hi there fellow web2py-users !
At the moment I'm working with / supervising a web2py-driven project
.....in which we use both " db.define_table( ..... " (in model) and "
current.db.define_table( ..... " (in some module methods that handles the
creation of data-relations from user-triggered events ).
In the outcome of the mentioned module methods ......the DAL table
definition creates the actual tables in the database .... before any
inserts occurs on these .... which is a fine and desired behavior in our
situation.
Our fixed table definitions in the model .... on the other hand ....are not
giving rise to actual table creations in database until any inserts occur
on these definitions .....this behavior is suitable for the majority of
our fixed table definitions ... except for some smaller number of them for
which select-operations, trough DAL, need to be possible ....even if no
data have been inserted yet.
With the described situation as background I have two general questions to
raise:
1. Why does the DAL table definitions in the module methods produce
actual table creations in database ( before any inserts ) ?
2. What is the most correct / intended method / way to achieve actual
table creations in database from DAL-definitions in the model ( before any
inserts ) ?
Additional remark : we prepare the availability of the DAL-object in the
module's current instance by adding the following in the model:
from gluon import current
current.db = db
I'm indeed sincerely thankful in advance for any answers ...that
helps resolving my two questions.
Sending my best regards ! / Peter
--
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/groups/opt_out.