Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

Ticket #48 (defect)

Opened 7 years ago

Last modified 7 years ago

unitclass.identifiers should be strings, not property instances

Status: closed (fixed)

Reported by: fumanchu Assigned to: fumanchu
Priority: major Milestone: 1.5
Component: Misc Keywords:
Cc: Estimate (total hours): 1

In 1.4, when subclassing, I will often modify the ID property like this:

class Thing(dejavu.Unit):
    ID = dejavu.UnitProperty(unicode)
    identifiers = (ID,)

If I forget to include the last line, then the identifiers list is silently broken, pointing to a UnitProperty? which no longer exists. If the "identifiers" tuple took names instead of property instances, this problem would go away. It would also make the storage layer code bit simpler.

Change History

03/07/06 23:42:04: Modified by fumanchu

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in [188]. You can still declare items in the identifiers tuple by property (instead of by name), but they will be replaced with their string keys in the metaclass constructor. In 1.6, we might take that out, forbid property references, and require names.

Regardless, the rest of the code base now treats unitclass.identifiers as a tuple of strings.