Modify ↓
Ticket #222 (assigned enhancement)
When running forwards and backwards migrations, raise an exception if someone uses a non-FakeORM model
| Reported by: | sfllaw@… | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 |
| Component: | migrations | Version: | 0.6-pre |
| Keywords: | Cc: |
Description
Sometimes, people may import a Model directly in a forwards() or backwards() migration.
This is a bad idea, because it works around the ORM. We can warn against this if we monkey-patch every models.get_models() so that __getattribute__() raises a NativeModelError.
This can be caught by run_forwards() and run_backwards() to let the developer know which migration was at fault.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Ah, interesting - I never considered MPing that one, only fiddling with the Migration's namespace.