Show
Ignore:
Timestamp:
11/14/07 10:57:14 (7 years ago)
Author:
ged
Message:
  • cleanup class attributes (in the attributes-based syntax) after the
    property is attached to its entity, so that SQLAlchemy is not confused.
    Only caused problem in the case of single inheritance and when omitting
    some values. See SA ticket #866.
  • some PEP8 fixes
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/elixir/properties.py

    r248 r267  
    114114        entity._descriptor.builders.append(self) 
    115115 
     116        # delete the original attribute so that it doesn't interfere with 
     117        # SQLAlchemy. 
     118        if hasattr(entity, name): 
     119            delattr(entity, name) 
     120 
    116121    def __repr__(self): 
    117122        return "Property(%s, %s)" % (self.name, self.entity)