Ticket #43 (closed defect: fixed)
Multitable table polymorphic inheritance clashes with autoload
| Reported by: | guest | Owned by: | ged |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.6 |
| Component: | core | Version: | 0.5.0 |
| Keywords: | polymorphic multi table inheritance | Cc: |
Description
Autoloading classes with polymorphic multi table inheritance fails during setup.
Create the database:
sqlite3 test.sqlite 'CREATE TABLE __main___fish (id INTEGER PRIMARY KEY , row_type VARCHAR(40)); CREATE TABLE __main___pike (fish_id INTEGER PRIMARY KEY REFERENCES __main___fish (id));'
Test it with:
from elixir import * metadata.bind = "sqlite:///test.sqlite" options_defaults["polymorphic"] = True options_defaults["autoload"] = True options_defaults["inheritance"] = "multi" class Fish(Entity): pass class Pike(Fish): pass setup_all()
A simple workaround to make it work is to insert another setup_all() between the class declarations:
class Fish(Entity): pass setup_all() class Pike(Fish): pass setup_all()
Change History
Note: See
TracTickets for help on using
tickets.
