Ticket #43 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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

Changed 5 years ago by ged

  • owner set to ged
  • status changed from new to accepted

Changed 5 years ago by ged

  • milestone set to 0.6

Changed 5 years ago by ged

  • status changed from accepted to closed
  • resolution set to fixed

fixed in r327, thanks for the report.

Note: See TracTickets for help on using tickets.