Opened 15 years ago

Last modified 15 years ago

#10112 closed

Python Crash with ORM Inheritance — at Version 1

Reported by: peterbraden@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Alex Gaynor)

This bug causes a reproducible crash in the python interpreter [python issue5014] on my system, so I can't give a specific traceback, but I believe that an infinite recursion is generated when I try and use the db_column in a TextField.

Basically, I'm modifying one of my models to allow inheritance of a field so rather than keep the existing field which cannot be overridden with a function in the subclass, I'm creating a property to access the field - ie:

class Foo(model):
  _bar = TextField(db_column = 'bar')

  bar = property(lambda x: x.bar)

class Bla(Foo):
  @property
  def bar(self): whatever

I think the db_column = 'bar' causes problems as there is a Foo.bar attribute so somewhere in the model this is screwing things up by making an infinite loop which for some reason is breaking the python runtime.

Reproducible with revision 9787

Change History (1)

comment:1 by Alex Gaynor, 15 years ago

Description: modified (diff)

edited for readability, please use the preview feature :)

Note: See TracTickets for help on using tickets.
Back to Top