2010/11/12 Mirek Zvolský <zvol...@seznam.cz>:
>>> Mariano Reingart
>
> Thanks for your response and practical experience with large system.
>
> I think the problem is clear:
> In current web2py philosophy the same data model becames valid or
> invalid based on the order of table definition commands. And if a
> model is complex, then there is no possibility how to make it valid/
> acceptable for web2py.

Yes, you can make any model valid to web2py, as Massimo said, just
don't use reference, use 'integer' as field type and IS_IN_DB
validator to change widgets and do lookups.

Foreign key constraints can be created and will be enforced at
database level, so basic migration and most things in web2py should
work the same.

> So as long this situation will continue, so long there will be block
> for more complex projects. The problem will come back again and again.
> It will be nice, if Massimo(?) could redesign this soon in such way:
> first create tables/fields in the db object, second turn on
> constraints in cycle over all tables and over all their foreign keys.

Or, may be not, for complex project we may include separate scripts to
do migrations and fixtures.

> Of course for large projects there will be a problem of too many
> tables and slow execution, especially when structures changes.
>>> Massimo Di Pierro:
>>> there is a problem if too many tables are in scope. We need to create
>>> a mechanisn for conditionally executing models based on the called
>>> action. Perhaps give models a subfolder structure like in views.
>
> Maybe this Massimo's idea is good. There should be always one model
> (default=db.py) with full database definition, and just this model
> would support structure migrations. In simple projects we could use
> this model (same situation as today for all web2py projects), in large
> projects subfolder models can be defined, which are smaller sub-sets
> of the whole model - they would not support migration, but they just
> will (together with controller) prepare data for specific view.

I don't think so.
Subfolder will add more complexity, further directories scan (with
performance penalities), and will make references, migrations and
fixtures even harder, fragmentating the model, etc.

> However, I don't know, if such system change in web2py would be good.
> Because who need such something to speed up his model, he can test
> request.controller and request.function in model and he can
> conditional call what he need.

I agree with this, advanced project will find the way (as an example,
I did it for the ERP, redefining the definition order and solving
other minor issues)

I think web2py should remain easy for begginers and most use cases,
and should allow complex ones to be possible, as now.

Regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com

Reply via email to