On Jul 6, 2010, at 4:18 AM, Harry Percival wrote:

> Hi,
> 
> I've got an error which occurs in ironpython but not in cpython. can anyone 
> replicate?  See attached. I'm using IPY 2.6.
> 
> <string>:1: DeprecationWarning: object.__init__() takes no parameters for 
> type _keyed_weakref
> <string>:1: DeprecationWarning: object.__init__() takes no parameters for 
> type KeyedRef
> <Movies object at 0x0000000000000034>
> <Directors object at 0x0000000000000038>
> caught exception 'NoneType' object has no attribute 'set'
> Traceback (most recent call last):
>  File "D:\workspace\resolver\test_multitable.py", line 54, in <module>
>    mapper(MoviesAndDirectors,j)#ipy errors here
>  File "D:\workspace\resolver\sqlalchemy\orm\__init__.py", line 818, in mapper
>    return Mapper(class_, local_table, *args, **params)
>  File "D:\workspace\resolver\sqlalchemy\orm\mapper.py", line 210, in __init__
>    self._configure_properties()
>  File "D:\workspace\resolver\sqlalchemy\orm\mapper.py", line 563, in 
> _configure_properties
>    self._configure_property(column_key,
>  File "D:\workspace\resolver\sqlalchemy\orm\mapper.py", line 755, in 
> _configure_property
>    prop.instrument_class(self)
>  File "D:\workspace\resolver\sqlalchemy\orm\properties.py", line 87, in 
> instrument_class
>    attributes.register_descriptor(
>  File "D:\workspace\resolver\sqlalchemy\orm\attributes.py", line 1424, in 
> register_descriptor
>    manager.instrument_attribute(key, descriptor)
>  File "D:\workspace\resolver\sqlalchemy\orm\attributes.py", line 1012, in 
> instrument_attribute
>    self.install_descriptor(key, inst)
>  File "D:\workspace\resolver\sqlalchemy\orm\attributes.py", line 1054, in 
> install_descriptor
>    setattr(self.class_, key, inst)
>  File "D:\workspace\resolver\sqlalchemy\orm\attributes.py", line 151, in 
> __set__
>    self.impl.set(instance_state(instance), instance_dict(instance), value, 
> None)
> AttributeError: 'NoneType' object has no attribute 'set'
> 
> 
> 
> does this look like a bug with ironpython? if so, I'll report it to the 
> developers, but i need a little more help tracking down exactly what's going 
> wrong...

its likely some slightly different behavior in ironpython regarding 
descriptors.   If you don't have a lot of SQLA experience, it would be 
extremely difficult to get SQLA running with a new Python interpreter.   
Getting it to run on Jython took a huge amount of effort and weeks/months of 
bughunting, both in SQLA and Jython itself.  We currently don't have any 
resources to get it to work on IronPython as well.


> 
> For bonus points:  In the attached database, there's a many-to-many 
> relationship between 'movies' and 'directors' via a simple joining table.  
> How come SQLA isn't able to figure this out on its own and let me just 
> join(movies_table, directors_table)? It seems unneccesary to have to specify 
> the extra join(movies_table,md_table).join(directors_table)...

I don't generally open full zipfiled applications, so if you want to attach a 
succinct, single-file code example that would help.   If you have relationships 
between two classes, the relationship() function is used to establish that, 
which would allow query.join(Movie.directors) to generate the joins 
automatically.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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