That's a good idea, thanks.

On Fri, Jan 17, 2014 at 6:52 PM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> I agree with Anthony, if you put table definitions inside functions you
> get a great deal of flexibility and speedup.
>
> e.g.
> def define_user_tables():
>    define_table('user' ....
>    define_table('user_data', ....
>    define_table('user_image' ...
>
> then you just call:
>  define_user_tables()
> wherever you need those tables...
>
>
>
> 2014/1/17 Anthony <abasta...@gmail.com>
>
>> Why don't you put your model definitions in modules (either inside of
>> functions or classes)? Then, when you need a particular model or set of
>> models, just import the relevant function/class and call it with whatever
>> arguments are needed to give you the models you want.
>>
>>
>> On Friday, January 17, 2014 10:45:24 AM UTC-5, Arnon Marcus wrote:
>>>
>>> I guess we can try to do conditional executions...
>>> It's quite a hassle, though, as the controllers don't do all the work -
>>> most of our queries are in fact in separate modules that the controllers
>>> use, which make it much eazier to maintain but it would make it more
>>> difficult to segregate the conditionallity of schema-definitions based on
>>> controllers.. Not sure what other criteria we could use though...
>>
>>  --
>> 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.
>>
>
>  --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.

Reply via email to