Changeset 165

Show
Ignore:
Timestamp:
11/09/08 17:17:29
Author:
thejimmyg
Message:

Adding SQLAlchemy 0.5 support to the users driver

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • AuthKit/trunk/AuthKit.egg-info/PKG-INFO

    r162 r165  
    5353        0.4.3 
    5454         
     55        * Adding SQLAlchemy 0.5 support, uses session.add() instead of session.save() 
     56        * The multi handler now handles WSGI applications implemented as iterators, 
     57        it already supported generators. The multi2.py example demonstrates this. 
     58        * Set the pylons.status_code_redirect environment variable on all redirected 
     59        AuthKit responses 
    5560        * Set the pylons.error_call environment variable on all redirected AuthKit 
    5661        responses 
  • AuthKit/trunk/AuthKit.egg-info/SOURCES.txt

    r158 r165  
    4343authkit/users/sqlalchemy_driver/sqlalchemy_04.py 
    4444authkit/users/sqlalchemy_driver/sqlalchemy_044.py 
     45authkit/users/sqlalchemy_driver/sqlalchemy_05.py 
    4546docs/community.txt 
    4647docs/download.txt 
     
    8687examples/docs/forward.py 
    8788examples/docs/multi.py 
     89examples/docs/multi2.py 
    8890examples/docs/open_id.py 
    8991examples/docs/open_id_sreg.py 
  • AuthKit/trunk/CHANGELOG.txt

    r163 r165  
    440.4.3 
    55 
     6* Adding SQLAlchemy 0.5 support, uses session.add() instead of session.save() 
    67* The multi handler now handles WSGI applications implemented as iterators, 
    78  it already supported generators. The multi2.py example demonstrates this. 
  • AuthKit/trunk/authkit/users/sqlalchemy_driver/__init__.py

    r152 r165  
    1515import sqlalchemy 
    1616 
    17 if sqlalchemy.__version__ >= '0.4.0': 
     17if sqlalchemy.__version__ >= '0.5': 
     18    from sqlalchemy_05 import * 
     19elif sqlalchemy.__version__ >= '0.4.0': 
    1820    # FIXME: specifically which version greater than 0.4.0 requires this? 
    1921    from sqlalchemy_044 import * 
  • AuthKit/trunk/authkit/users/sqlalchemy_driver/sqlalchemy_05.py

    r164 r165  
    1 # SQLAlchemy 0.4.4 Driver for AuthKit 
    2 # Based on update by Daniel Pronych 
    3 # Description: Custom SQLAlchemy 0.4.4 driver to work with AuthKit 0.4.0. 
    4  
    5 # This file assumes the following in the model used in Pylons 0.9.7 and the examples/user/database-model example 
    6 # * Removed all use of assign_ctx.mapper due to deprecation in 0.4. 
    7 # * Added insert for sqlalchemy.orm due to changes for SQLAlchemy 0.4. 
    8 # * Replaced usage of mapper with ctx.mapper for SQLAlchemy 0.4.4 ( > 0.4.0) 
     1# SQLAlchemy 0.5 Driver for AuthKit 
     2# Based on the SQLAlchemy 0.4.4 driver but using session.add() instead of  
     3# session.save() 
     4 
     5# This file assumes the following in the model used in Pylons 0.9.7 
    96 
    107from sqlalchemy import * 
     
    148145                    filter_by(name=group.lower()).first().uid 
    149146            ) 
    150         self.meta.Session.save(new_user) 
     147        self.meta.Session.add(new_user) 
    151148        self.meta.Session.flush() 
    152149 
     
    160157            raise AuthKitError("Role %r already exists"%role) 
    161158        new_role = self.model.Role(role.lower()) 
    162         self.meta.Session.save(new_role) 
     159        self.meta.Session.add(new_role) 
    163160        self.meta.Session.flush() 
    164161         
     
    172169            raise AuthKitError("Group %r already exists"%group) 
    173170        new_group = self.model.Group(group.lower()) 
    174         self.meta.Session.save(new_group) 
     171        self.meta.Session.add(new_group) 
    175172        self.meta.Session.flush() 
    176173