[web2py] DAL table definition behaves differently in model ...versus... a module method ??
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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Module import problem ----> (No module named modules)
Den onsdagen den 6:e november 2013 kl. 23:45:24 UTC+1 skrev Cliff Kachinske: > > Do you have __init__.py in your modules folder? > > On Wednesday, November 6, 2013 2:36:16 PM UTC-5, Niphlod wrote: >> >> posting what you're trying to import may help us to figure out the cause >> and give a solution ^_^ >> >> >>> >>> >>> :-)hmmm NOPE ! ... Here it was ! .. this was the >>> root-cause to the problem ... I must have deleted it by mistake somehow >>> (strange !!). Anyway ... thanks for the solving counter-remark/question >>> indeed / 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Module import problem ----> (No module named modules)
Ticket ID 127.0.0.1.2013-11-06.17-54-22.fa80574c-c662-4f65-a86f-45ddf4baf428 No module named modules Version web2py™ Version 2.7.3-stable+timestamp.2013.10.11.23.12.01 Python Python 2.7.3: /usr/bin/python (prefix: /usr) Hi there fellow web2py-users I'm trying out web2py for a smaller but evolving project of mine so far my understanding of ...and code prototyping with web2py has been a truly/solid excellent experience indeed but recently I stumbled into this somewhat unexpected import-error while trying to import a module ( not named "modules" ) saved into the "modules" sub-folder of the app. I have not managed to figure out so far by myself about what root-cause might be raising this error. I hope/think we will be able to sort this issue out relatively soon from now .as it feels like ..some minor statement and/or string is missing somewhere in the web2py-source. 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.