Hi all,

I've done the svn tutorial as suggested + gone through the datamapping / advanced data mapping 3x each.

I seem to be ok on the SELECTs with sqlalchemy, but still having trouble with the writes.

Specifically I keep running into a wall on this one issue:

Going back to my example, again its simple, I just can't figure this out based on the docs ( it thought it would have been similar to http://sqlalchemy.org/docs/datamapping.myt#datamapping_onetoone or

myInstance = model.Instance.mapper.select_by(
        name = 'primary_email',
        type = model.InstanceType.mapper.select_by( name = 'email' )
)

Trying that, I get
        AttributeError: 'LazyLoader' object has no attribute 'columns'

I thought 'maybe I should try it with eager loader or property loader?' same thing.

------

instance_type = Table('instance_type', __engine__,
    Column('id', Integer, primary_key=True),
    Column('name', String(255) , unique=instance_type_name_idx' ),
)
instance = Table('instance', __engine__,
    Column('id', Integer, primary_key=True),
Column('instance_type_id' , Integer , ForeignKey ("instance_type.id") ),
    Column('name', String(255) , unique='instance_name_idx' ),
)

class Instance(object):
        pass
class InstanceType(object):
        pass

InstanceType.mapper = mapper( InstanceType , instance_type )
Instance.mapper = mapper( Instance , instance ,
        properties = {
                'type' : relation( InstanceType.mapper ) ,
        }
)
----
i also tried
----
Instance.mapper = mapper( Instance , instance ,
        properties = {
                'type' : relation( mapper(InstanceType , instance_type ) ),
        }
)

----------

If anyone can make a suggestion, I'd be grateful.



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to