Changeset 505 for elixir/trunk/elixir

Show
Ignore:
Timestamp:
10/15/09 14:41:44 (3 years ago)
Author:
ged
Message:

- using_options_defaults and using_table_options statements can be used several

times within the same class (closes #70).

Location:
elixir/trunk/elixir
Files:
2 modified

Legend:

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

    r504 r505  
    145145                self.identity = self.mapper_options['polymorphic_identity'] 
    146146            else: 
    147                 #TODO: include module name 
     147                #TODO: include module name (We could have b.Account inherit 
     148                # from a.Account) 
    148149                self.identity = entity.__name__.lower() 
    149150        elif 'polymorphic_identity' in self.mapper_options: 
  • elixir/trunk/elixir/options.py

    r502 r505  
    231231            raise Exception("'%s' is not a valid option for Elixir entities." 
    232232                            % kwarg) 
    233  
    234     entity.options_defaults = kwargs 
     233    if not hasattr(entity, 'options_defaults'): 
     234        entity.options_defaults = {} 
     235    entity.options_defaults.update(kwargs) 
    235236 
    236237 
     
    245246 
    246247def using_table_options_handler(entity, *args, **kwargs): 
    247     entity._descriptor.table_args = list(args) 
     248    entity._descriptor.table_args.extend(list(args)) 
    248249    entity._descriptor.table_options.update(kwargs) 
    249250