in my case it must be something different. The following code works
perfectly fine in 0.5.2:

mapper(Contact, CONTACTS)

mapper(Atom, ATOMS,
    properties = {
        'Contacts': relation(Contact,
                        primaryjoin = Contact.atom_id==ATOMS.c.id,
                        foreign_keys = [Contact.atom_id], lazy=True,
uselist=True, viewonly=True,
                        backref = backref('Atom', primaryjoin =
Contact.atom_id==ATOMS.c.id,
                                            foreign_keys =
[ATOMS.c.id],
                                            lazy=True, uselist=False,
viewonly=True)
                        )
    })

In: atom = session.query(Atom).filter(Atom.id==57).one()

In: atom.Contacts
Out: [<Contact(57, 9)>]

In 0.5.3 however, the backref() will throw the following error:

ArgumentError: Atom.Contacts and back-reference Contact.Atom are both
of the same direction <symbol 'ONETOMANY>.  Did you mean to set
remote_side on the many-to-one side ?

Any ideas?

On Apr 9, 3:48 pm, Michael Bayer <zzz...@gmail.com> wrote:
> On Apr 2, 10:36 am, Andreas Jung <li...@zopyx.com> wrote:
>
>
>
> > The related code is:
>
> >     class Hierarchies(Base, AsDictMixin):
> >         __tablename__ = 'hierarchies'
> >         __table_args__ = ( { 'autoload' : True, })
> >         __mapper_args__ = ({'extension' : HierachiesDeletionLogger()})
>
> >         id = Column(Integer, Sequence('hierarchies_seq'), primary_key=True)
> >         parent_id = Column(Integer, ForeignKey('hierarchies.id'))
> >         hierarchyshare_id = Column(Integer, ForeignKey('hierarchies.id'))
> >         pos = Column(Integer)
>
> >     Hierarchies.subscribed_by = relation('Hierarchies',
>
> > primaryjoin=Hierarchies.hierarchyshare_id==Hierarchies.id,
> >                                  backref=backref("subscriber",
> > remote_side=Hierarchies.hierarchyshare_id),
> >                                  remote_side=Hierarchies.hierarchyshare_id,
> >                                  uselist=True,
> >                                  )
>
> yes, you have the same "remote_side" on both the forwards and the
> backwards reference, indicating they are both one-to-many from
> hierarchies.id to hiearchies.parent_id.   The remote_side in the many-
> to-one backref should point to Hierarchies.id.
>
>
>
> > Anything I am missing or something that changed over the last two weeks
> > at this point?
>
> > Andreas
>
> > - --
> > ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
> > Web:www.zopyx.com-Email: i...@zopyx.com - Phone +49 - 7071 - 793376
> > Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
> > Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
> > - ------------------------------------------------------------------------
> > E-Publishing, Python, Zope & Plone development, Consulting
>
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (Darwin)
> > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> > iEYEARECAAYFAknUzXIACgkQCJIWIbr9KYwdZgCfVfo9ZN2bNPM4iaxZoFXdcuuE
> > yPoAoMaqN2Wr219oL+kviY7dtotIqh/M
> > =RG8E
> > -----END PGP SIGNATURE-----
>
> >  lists.vcf
> > < 1KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to