> What is preventing you from simply mapping different classes ?
Different Customers uses different (her own) table spaces. So we must map a 
Class to different tables.

You remove entity_name, but how you specify the 'user dependent storage' in 
sqlalchem 0.5? This behavior is a typical orm-property. I know its a 
"enterprise requirement". But it is the reason why I use sqlalchemy.

I spent some time to migrate to sqlalchemy 0.4 and it's to late to go back to 
0.3. What can I do to add objects to properties (InstumentedLists) in 
sqlalchemy 0.4 (with different mappers)?

Thanks
tyr





----- Original Nachricht ----
Von:     Michael Bayer <[EMAIL PROTECTED]>
An:      sqlalchemy@googlegroups.com
Datum:   13.10.2008 17:42
Betreff: [sqlalchemy] Re: 0.4: can not append objects to instrumentedlists

> 
> the entity_name feature is somewhat broken in 0.4 and has been removed  
> entirely in 0.5 - there's too much ambiguity in its usage (namely, the  
> attributes/behavior of a class cannot be determined until the class is  
> associated with a specific mapper via the session).   Its possible  
> that this is related to the issue you're having.
> 
> What is preventing you from simply mapping different classes ?
> 
> 
> 
> 
> On Oct 13, 2008, at 11:31 AM, [EMAIL PROTECTED] wrote:
> 
> >
> >
> >
> > I use entity_name's for all mappers. So I dont have mappers with
> > entity_name = None.
> >
> > With sqlalchemy 0.4 I run into errors if I try to add objects to
> > InstrumentedList's:
> >
> > (Pdb) len( self.users )
> > 1
> > (Pdb) self.users
> > [<common.User object at 0x1d1992a8>]
> > (Pdb) type( self.users )
> > <class 'sqlalchemy.orm.collections.InstrumentedList'>
> > (Pdb)  self.users.append( user )
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/collections.py",
> > line 921, in append
> >    item, _sa_initiator)
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/attributes.py", line
> > 517, in fire_append_event
> >    ext.append(instance, value, initiator or self)
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/attributes.py", line
> > 713, in append
> >    getattr(child.__class__, self.key).impl.append(child._state,
> > instance, initiator, passive=True)
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/attributes.py", line
> > 294, in append
> >    self.set(state, value, initiator)
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/attributes.py", line
> > 437, in set
> >    old = self.get(state)
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/attributes.py", line
> > 278, in get
> >    callable_ = self._get_callable(state)
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/attributes.py", line
> > 255, in _get_callable
> >    return self.callable_(state.obj())
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/strategies.py", line
> > 318, in class_level_loader
> >    localparent = mapper.object_mapper(instance)
> >  File "SQLAlchemy-0.4.8-py2.4.egg/sqlalchemy/orm/util.py", line 371,
> > in object_mapper
> >    raise exceptions.InvalidRequestError("Class '%s' entity name '%s'
> > has no mapper associated with it" % (object.__class__.__name__,
> > getattr(object, '_entity_name', entity_name)))
> > InvalidRequestError: Class 'User' entity name 'None' has no mapper
> > associated with it
> >
> >
> > It is a mistake on my part or a bug/broken feature (I migrate from
> > sqlalchemy 0.3 and it works with 0.3)?
> >
> > thanks and greetings,
> > tyr
> >
> > >
> 
> 
> > 
> 

Jetzt komfortabel bei Arcor-Digital TV einsteigen: Mehr Happy Ends, mehr 
Herzschmerz, mehr Fernsehen! Erleben Sie 50 digitale TV Programme und optional 
60 Pay TV Sender, einen elektronischen Programmführer mit Movie Star 
Bewertungen von TV Movie. Außerdem, aktuelle Filmhits und spannende Dokus in 
der Arcor-Videothek. Infos unter www.arcor.de/tv

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to