IMHO, models should be read only once (start), and then upon admin wish by
using some sort of reload, I believe this kind of realtime configuration of
web2py comes at a huge cost of performance and no percieved benefets, here
is a  real world example, I have applications running for years now, the
code never changed, but still those applications at each and every request
read model file and process it for each one of the thousand of requests per
day.
I might be wrong.
On Apr 27, 2012 5:58 AM, "Anthony" <abasta...@gmail.com> wrote:

> But the problem is that the data entered from, say index() is not
>> available at db.py. Am I right?
>> If a user enters entries to table "table_names", will db.py see them? Are
>> the data persistent?
>>
>
> Alan is suggesting that the index function would store the user input in a
> database table, and then the db.py model file would read that database
> table (on subsequent requests) and use the metadata stored there to
> generate the table definition for the user's table. This is one of three
> suggestions I made on SO:
> http://stackoverflow.com/questions/10317214/web2py-create-table-from-user-input/10318253#10318253.
> Did you try any of those solutions?
>
>
>> Also my understanding from reading the online book is that the model
>> files are run once when starting the application. Could you tell me how I
>> can make the for-loop run after each user enters a entry in the table?
>
>
> No, model files are run on every request, not just upon starting the
> application (actually, there is no "starting the application" --
> application code is simply run on each request, and only upon requests).
>
> Anthony
>
>>

Reply via email to