Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2081 (closed task: wontfix)

Opened 11 years ago

Last modified 9 years ago

Model Package import issues

Reported by: jorge.vargas Owned by: anonymous
Priority: high Milestone: 2.1rc1
Component: SQLAlchemy Version: trunk
Severity: normal Keywords:


Given the way SQLAlchemy is initialized it currently create a potential name collision between the user defined modules (model/*.py) and ANY top level module in the python installation.

I'm not saying this is a bug because it's documented but it is something we should take care of. The chances of a name collision are too high and the results too obscure specially to new developers just starting out.

For example Jon, creates project myfirstapp, then goes into model copies over model.templates and names it well myfirstapp, when he runs setup-app everything goes to hell because model.init.py is loading from myfrstapp import * which basically throws things off.

The worst part of this is that any top level package is affect so if you name your model file tg.py or even something on the stdlib things will go wrong.

I'm setting this as a task because we should investigate how other big project handle this issue.

Change History

comment:1 Changed 10 years ago by mramm

  • Milestone changed from 2.0 to 2.1

Hmm, this is mostly just about understanding how python works. We can perhaps make it a little easier, but IMHO really we can't solve the problem in any reasonable way.

comment:2 Changed 10 years ago by jorge.vargas

I'm not entirely sure about that. The fact that you have to import things at the end of the file is weird.

comment:3 Changed 9 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

Feel free to open a ticket to make some specific change. But as is this ticket is not actionable.

comment:4 Changed 9 years ago by percious

  • Milestone changed from 2.1 to 2.1rc1
Note: See TracTickets for help on using tickets.