So I have to execute it with this craziness

from applications.app1 import myModel

Its crazy because this whole design principle breaks when dealing with
external scripts.

--
Thadeus





On Sat, May 15, 2010 at 6:23 AM, Iceberg <iceb...@21cn.com> wrote:
> Just some thought. What if we could somehow change app1's model into a
> module, automatically? For example
>
>   app1/models/__init__.py  # Add this
>
> And then append this into your app1/models/db.py:
>   __all__ = [ 'what', 'you', 'wanna', 'share' ] # This might not be
> necessary
>
> Havn't tried it. But if it works, we only have two places for model
> files, as good as django.
>
> On May15, 6:51pm, Thadeus Burgess <thade...@thadeusb.com> wrote:
>> Yes, web2py runs fine with 50 models. And this is awesome if your just
>> dealing with one application....
>>
>> What gets messy is when you have two applications, which depend on
>> each others models.
>>
>> You end up having to stick the common models in a module, and
>> importing it, but now you have three places to edit model files, and
>> this is where django shines in its re-usable app structure..
>>
>> In web2py you have to do
>>
>> from common_model import myModel
>>
>> in both applications, its complex and stupid. In django its just
>>
>> from myapp1 import myModel
>>
>> And you start using it, everything is still defined in myapp1, no need
>> for redefining your models or even sticking them in a third location.
>>
>> --
>> Thadeus
>

Reply via email to