Changeset 274
- Timestamp:
- 12/04/07 10:36:20 (6 years ago)
- Files:
-
- 1 modified
-
elixir/trunk/elixir/ext/associable.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elixir/trunk/elixir/ext/associable.py
r267 r274 188 188 189 189 entity = self.entity 190 print "adding property", attr_name 190 191 entity.mapper.add_property( 191 192 attr_name, … … 194 195 ) 195 196 196 # this is strange! self.name is both set via mapper synonym and197 # the python property198 entity.mapper.add_property(self.name, sa.orm.synonym(attr_name))199 200 197 if self.uselist: 201 198 def get(self): 199 print "prop_get" 202 200 if getattr(self, attr_name) is None: 203 201 setattr(self, attr_name, … … 220 218 setattr(entity, self.name, property(get, set)) 221 219 220 # self.name is both set via mapper synonym and the python 221 # property, but that's how synonym properties work. 222 # adding synonym property after "real" property otherwise it 223 # breaks when using SQLAlchemy > 0.4.1 224 entity.mapper.add_property(self.name, sa.orm.synonym(attr_name)) 225 222 226 # add helper methods 223 227 def select_by(cls, **kwargs):
