[sqlalchemy] Re: dictionaries collection_class

2007-06-16 Thread Ron

Now I'm having trouble with updating values in AttributeDict:

so

obj.attrs['key'] = 'somevalue'   (works)
obj.attrs['key'] = 'newvalue'(second one doesn't work)

I get this error:

  File /usr/local/lib/python2.4/site-packages/SQLAlchemy-0.3.8-
py2.4.egg/sqlalchemy/orm/mapper.py, line 679, in init
raise e
TypeError: lambda() takes exactly 2 arguments (3 given)

Any more ideas?

-Ron


On Jun 12, 2:52 pm, jason kirtland [EMAIL PROTECTED] wrote:
 Ron wrote:

  Nevermind.  I see what I was doing.  In much of my code it worked
  fine, just like a dictionary.

  But in another part of my code I do:

  for i in self.attrs:
 ...blah

  which works like a list.  I remember when I saw the __iter__
  implementation requirement noting that that may be confusing.

 That's a side-effect of the way dict collections are managed by the
 InstrumentedList.  The iterator behavior will be over keys as you'd
 expect in 0.4, both on dict collection classes and in dict-based
 association proxies.

 I think the 0.3 association proxy does that only to be consistent
 with the underlying attribute's iterator, but I don't see any
 strong reason to keep that behavior in 0.3, especially as
 association dict support is pretty much brand new.  Making the
 assoc proxy's iterator truly dict-like can go in 0.3.9 if there's
 call.

 Cheers,
 Jason


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: dictionaries collection_class

2007-06-16 Thread Ron

Now I'm having trouble with updating values in AttributeDict:

so

obj.attrs['key'] = 'somevalue'   (works)
obj.attrs['key'] = 'newvalue'(second one doesn't work)

I get this error:

  File /usr/local/lib/python2.4/site-packages/SQLAlchemy-0.3.8-
py2.4.egg/sqlalchemy/orm/mapper.py, line 679, in init
raise e
TypeError: lambda() takes exactly 2 arguments (3 given)

Any more ideas?

-Ron


On Jun 12, 2:52 pm, jason kirtland [EMAIL PROTECTED] wrote:
 Ron wrote:

  Nevermind.  I see what I was doing.  In much of my code it worked
  fine, just like a dictionary.

  But in another part of my code I do:

  for i in self.attrs:
 ...blah

  which works like a list.  I remember when I saw the __iter__
  implementation requirement noting that that may be confusing.

 That's a side-effect of the way dict collections are managed by the
 InstrumentedList.  The iterator behavior will be over keys as you'd
 expect in 0.4, both on dict collection classes and in dict-based
 association proxies.

 I think the 0.3 association proxy does that only to be consistent
 with the underlying attribute's iterator, but I don't see any
 strong reason to keep that behavior in 0.3, especially as
 association dict support is pretty much brand new.  Making the
 assoc proxy's iterator truly dict-like can go in 0.3.9 if there's
 call.

 Cheers,
 Jason


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: MSSQL: using pyODBC

2007-06-16 Thread Paul Johnston

Che,

trying SA with MSSQL Express through unixODBC/pyODBC  encountered the
following problem:
  

Well, your test script works fine for me on Windows, but you probably 
knew that already.

You should expect to hit a lot of problems using MSSQL from Unix. For 
now, I suggest you have a go with PyMSSQL and see if that works any 
better that PyODBC.

If doing this on Unix is important to you, I would encourage you to get 
involved with the group and help with some bug fixes. Who knows, just a 
few fixes may improve the situation greatly.

Take care,

Paul

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[sqlalchemy] Re: dictionaries collection_class

2007-06-16 Thread jason kirtland

Ron wrote:
 Now I'm having trouble with updating values in AttributeDict:
 
 so
 
 obj.attrs['key'] = 'somevalue'   (works)
 obj.attrs['key'] = 'newvalue'(second one doesn't work)
 
 I get this error:
 
   File /usr/local/lib/python2.4/site-packages/SQLAlchemy-0.3.8-
 py2.4.egg/sqlalchemy/orm/mapper.py, line 679, in init
 raise e
 TypeError: lambda() takes exactly 2 arguments (3 given)
 
 Any more ideas?
 
 -Ron

Fixed in 2739.  (a silly typo)

-jek


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---