Changeset 465 for elixir/trunk/elixir

Show
Ignore:
Timestamp:
09/24/09 17:16:27 (3 years ago)
Author:
ged
Message:

- Fixed Elixir to work with the future SQLAlchemy 0.6 (trunk as of 6377).
- Fixed MIGRATION aid
- added some more FIXME

Location:
elixir/trunk/elixir
Files:
2 modified

Legend:

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

    r429 r465  
    172172            self.property = self.column 
    173173 
    174         if self.property: 
     174        if self.property is not None: 
    175175            self.add_mapper_property(self.name, self.property) 
    176176 
  • elixir/trunk/elixir/relationships.py

    r458 r465  
    870870        if options.MIGRATION_TO_07_AID: 
    871871            self.column_format = \ 
    872                 migration_aid_column_formatter(self.column_format) 
     872                migration_aid_m2m_column_formatter(self.column_format) 
    873873 
    874874        self.filter = filter 
     
    895895 
    896896    def create_tables(self): 
    897         if self.table: 
     897        if self.table is not None: 
    898898            if 'primaryjoin' not in self.kwargs or \ 
    899899               'secondaryjoin' not in self.kwargs: 
     
    902902 
    903903        if self.inverse: 
    904             if self.inverse.table: 
     904            if self.inverse.table is not None: 
    905905                self.table = self.inverse.table 
    906906                self.primaryjoin_clauses = self.inverse.secondaryjoin_clauses 
     
    10051005                    assert len(colnames) == len(desc.primary_keys) 
    10061006                else: 
     1007                    #FIXME: desc is not the target desc. Do I need to fix to 
     1008                    # code or the doc? in fact the relname corresponds to the 
     1009                    # relationship going from the entity to the M2M, so the new 
     1010                    # naming scheme might not really make sense 
    10071011                    data = {# relationship info 
    10081012                            'relname': rel and rel.name or 'inverse', 
     
    10111015                            'numifself': e1_desc is e2_desc and str(num + 1) 
    10121016                                                            or '', 
    1013                             # target info 
    1014                             'target': desc.entity, 
     1017                            # source (not target!) info 
     1018                            'source': desc.entity, 
    10151019                            'entity': desc.entity.__name__.lower(), 
    10161020                            'tablename': desc.tablename 
     
    11131117        if new_name != old_name: 
    11141118            complete_data = data.copy() 
    1115             #TODO: use explicit num and selfref variables 
    11161119            complete_data.update(old_name=old_name, 
    11171120                                 new_name=new_name, 
     
    11201123            # generation is triggered by setup_all(), not by the declaration 
    11211124            # of the offending relationship. 
     1125            #FIXME: entity is probably wrong here since it refers to the target 
     1126            #entity. 
    11221127            warnings.warn("The generated column name for the '%(relname)s' " 
    11231128                          "relationship on the '%(entity)s' entity changed "