2010/11/11 Mirek Zvolský <zvol...@seznam.cz>:
> Oh no!,no!,no! please no!
> I still hope it's my mistake only. I simple cannot believe, that this
> is behaviour of web2py data model. Are we in year 1960?
> Friends, take a look to the oldest database implementations older as
> SQL language, in MS-DOS times, f.e. dBase III, FoxBase, Clipper. And
> earlier on the mainframes this was sure known and allowed too.
> There were NEVER problems with such type of foreign keys! If we have
> model with 5 tables, maybe we can avoid use of such foreign keys,
> however if we have a realy bussiness application with about 50 tables?

I agree, I have an ERP system with +70 tables, it very hard to define
models in order.
Look at this thread:
http://groups.google.com/group/web2py-
developers/browse_thread/thread/82c2128be252721a#

> I know I'm beginner here, however I have choosen web2py as a world
> leading and best designed framework. Should I find somewhere else? Has
> Django same basic problems with data model?

No, it has other problems (ie., it don't have automatic migrations nor
automatic lookups,  that both eases the reference issue), you can
define references as string (like web2py "reference ..."), and the
table may not be defined.

The issue is not that simple, it affect migrations and fixtures.

> Or is there a workaround in web2py?
> I have idea about 2 possible ways:
>
>
> 1)
> Can I patch web2py to disable call of _create_references() after
> separate table is added to the model? _create_references() are then to
> be called after all tables are already added, in cycle through all
> tables in the model.

I've tried that too, but it solves part of the problem.
As I said, migrations should be done in two part (first creating
table, second appling constraints), so that is a more complex solution
and patch.

> 2)
> Can I use standard 'integers' for foreign keys instead of
> 'reference..'?

Yes, indeed you may have to do that anyway, as automatic migrations
may not work for complex models like this (by now).

Regards,

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

Reply via email to