Changeset 119

Show
Ignore:
Timestamp:
06/08/07 10:28:46 (6 years ago)
Author:
ged
Message:

- Made EntityMeta public, so that people can actually define their own base

class (I thought I already made this possible but it seems like not).

- Removed all all declarations from subpackages as they are IMHO useless

since we can't get to them from outside of the lib, consequently replaced
all the "from xyz import *" lines in init.py by explicit imports.

Location:
elixir/trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/CHANGES

    r117 r119  
    110.4.0 
     2- Added ext sub-package for additional Elixir statements. 
    23- Added ext.associable for generating polymorphic associations with Elixir 
    34  Statements. (Many thanks to Mike Bayer for his support on writing this.) 
    4 - Added ext sub-package for additional Elixir statements. 
    55- Added default __init__ method on entities so that subclasses can override it 
    66  and still have the "set attribute by keyword" behavior by calling super() 
    77- Added .q property on the metaclass, so that you can get a query on an entity 
    88  by just using Entity.q, instead of using Entity.query() 
     9- Made EntityMeta public, so that people can actually define their own base  
     10  class. 
    911- Fixed relationships to tables using a schema (Patch by Neil Blakey-Milner) 
    1012 
  • elixir/trunk/elixir/__init__.py

    r89 r119  
    1919import sqlalchemy 
    2020 
    21 from sqlalchemy.ext.sessioncontext  import SessionContext 
    22 from sqlalchemy.types               import * 
    23 from elixir.options                 import * 
    24 from elixir.entity                  import Entity, EntityDescriptor 
    25 from elixir.fields                  import * 
    26 from elixir.relationships           import * 
     21from sqlalchemy.ext.sessioncontext import SessionContext 
     22from sqlalchemy.types import * 
     23 
     24from elixir.options import using_options, using_table_options, \ 
     25                           using_mapper_options, options_defaults 
     26from elixir.entity import Entity, EntityMeta, EntityDescriptor 
     27from elixir.fields import has_field, with_fields, Field 
     28from elixir.relationships import belongs_to, has_one, has_many, \ 
     29                                 has_and_belongs_to_many 
    2730 
    2831try: 
     
    3336__version__ = '0.3.0' 
    3437 
    35 __all__ = ['Entity', 'Field', 'has_field', 'with_fields', 
     38__all__ = ['Entity', 'EntityMeta', 'Field', 'has_field', 'with_fields', 
    3639           'belongs_to', 'has_one', 'has_many', 'has_and_belongs_to_many', 
    3740           'using_options', 'using_table_options', 'using_mapper_options', 
  • elixir/trunk/elixir/entity.py

    r113 r119  
    1818import elixir 
    1919 
    20  
    21 __all__ = ['Entity'] 
    22  
    23 __pudge_all__ = __all__ 
     20__pudge_all__ = ['Entity', 'EntityMeta'] 
    2421 
    2522DEFAULT_AUTO_PRIMARYKEY_NAME = "id" 
     
    296293class EntityMeta(type): 
    297294    """ 
    298     Entity meta class. 
     295    Entity meta class.  
     296    You should only use this if you want to define your own base class for your 
     297    entities (ie you don't want to use the provided 'Entity' class). 
    299298    """ 
    300299 
  • elixir/trunk/elixir/fields.py

    r82 r119  
    7777from elixir.statements      import Statement 
    7878 
    79 __all__ = ['has_field', 'with_fields', 'Field'] 
    80  
    8179__pudge_all__ = ['Field'] 
    8280 
  • elixir/trunk/elixir/options.py

    r96 r119  
    112112from elixir.statements import Statement 
    113113 
    114 __all__ = ['using_options', 'using_table_options', 'using_mapper_options', 
    115            'options_defaults'] 
    116  
    117114__pudge_all__ = ['options_defaults'] 
    118115 
  • elixir/trunk/elixir/relationships.py

    r114 r119  
    198198import sys 
    199199 
    200  
    201 __all__ = ['belongs_to', 'has_one', 'has_many', 'has_and_belongs_to_many'] 
    202  
    203200__pudge_all__ = [] 
    204201