[sqlalchemy] Re: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-21 Thread Harish K Vishwanath
Hello Michael,

Thanks for your input! I got the latest trunk from SVN.

However, if my app specific baseclass is an old style class, it still
breaks., this time in orm\attributes.py

Traceback (most recent call last):
  File SqlDB_Test.py, line 9, in ?
dbo = SqlDB(SqlDB_Test.Sqlite,c:\\testdbs)
  File d:\recogsys\src\python\RSITerm\SQLConvert\SqlDB.py, line 77, in
__init_
_
self.initSetup(echo)
  File d:\recogsys\src\python\RSITerm\SQLConvert\SqlDB.py, line 115, in
initSe
tup
elixir.setup_all(True)
  File d:\recogsys\src\python\rsiterm\__init__.py, line 145, in setup_all

  File
c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
line 816, in setup_entities
  File
c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
line 409, in setup_mapper
  File
c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
qlalchemy\orm\__init__.py, line 643, in mapper
return Mapper(class_, local_table, *args, **params)
  File
c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
qlalchemy\orm\mapper.py, line 197, in __init__
self.__compile_class()
  File
c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
qlalchemy\orm\mapper.py, line 852, in __compile_class
manager = attributes.create_manager_for_cls(self.class_)
  File
c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
qlalchemy\orm\attributes.py, line 1494, in create_manager_for_cls
manager = factory(class_)
  File
c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
qlalchemy\orm\attributes.py, line 1047, in __init__
cls_state = manager_of_class(base)
  File
c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
qlalchemy\orm\attributes.py, line 1511, in manager_of_class
finder = self.manager_finders[cls]
  File C:\Python24\lib\weakref.py, line 219, in __getitem__
return self.data[ref(key)]
TypeError: cannot create weak reference to 'classobj' object

This error goes away when I make my app baseclass as a new style class. It
is not giving any problems with Exceptions class in Py2.4 though.

Could this be a possible issue?

On Wed, Aug 20, 2008 at 9:28 PM, Michael Bayer [EMAIL PROTECTED]wrote:



 On Aug 20, 2008, at 11:52 AM, Harish K Vishwanath wrote:

  Hello,
 
  Sorry if I am being stupid. I saw the ticket and r0535 and 537
  changeset. Which version of SQLA incorporates these changesets?


 no worries...use the latest trunk, which will ultimately be released
 either as 0.5beta4 or 0.5.0.



 



-- 
Regards,
Harish

--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-21 Thread jason kirtland

Thanks for the traceback.  Give r5050 a try.

Cheers,
Jason


Harish K Vishwanath wrote:
 Hello Michael,
 
 Thanks for your input! I got the latest trunk from SVN.
 
 However, if my app specific baseclass is an old style class, it still 
 breaks., this time in orm\attributes.py
 
 Traceback (most recent call last):
   File SqlDB_Test.py, line 9, in ?
 dbo = SqlDB(SqlDB_Test.Sqlite,c:\\testdbs)
   File d:\recogsys\src\python\RSITerm\SQLConvert\SqlDB.py, line 77, in 
 __init_
 _
 self.initSetup(echo)
   File d:\recogsys\src\python\RSITerm\SQLConvert\SqlDB.py, line 115, 
 in initSe
 tup
 elixir.setup_all(True)
   File d:\recogsys\src\python\rsiterm\__init__.py, line 145, in setup_all
 
   File 
 c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
 line 816, in setup_entities
   File 
 c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
 line 409, in setup_mapper
   File 
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
 qlalchemy\orm\__init__.py, line 643, in mapper
 return Mapper(class_, local_table, *args, **params)
   File 
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
 qlalchemy\orm\mapper.py, line 197, in __init__
 self.__compile_class()
   File 
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
 qlalchemy\orm\mapper.py, line 852, in __compile_class
 manager = attributes.create_manager_for_cls(self.class_)
   File 
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
 qlalchemy\orm\attributes.py, line 1494, in create_manager_for_cls
 manager = factory(class_)
   File 
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
 qlalchemy\orm\attributes.py, line 1047, in __init__
 cls_state = manager_of_class(base)
   File 
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
 qlalchemy\orm\attributes.py, line 1511, in manager_of_class
 finder = self.manager_finders[cls]
   File C:\Python24\lib\weakref.py, line 219, in __getitem__
 return self.data[ref(key)]
 TypeError: cannot create weak reference to 'classobj' object
 
 This error goes away when I make my app baseclass as a new style class. 
 It is not giving any problems with Exceptions class in Py2.4 though.
 
 Could this be a possible issue?
 
 On Wed, Aug 20, 2008 at 9:28 PM, Michael Bayer [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 
 
 On Aug 20, 2008, at 11:52 AM, Harish K Vishwanath wrote:
 
   Hello,
  
   Sorry if I am being stupid. I saw the ticket and r0535 and 537
   changeset. Which version of SQLA incorporates these changesets?
 
 
 no worries...use the latest trunk, which will ultimately be released
 either as 0.5beta4 or 0.5.0. http://0.5.0.
 
 
 
 
 
 
 
 -- 
 Regards,
 Harish
 
  


--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-21 Thread Harish K Vishwanath
Thanks Jason. Downloaded R5051, it works fine!

Cheers,
Harish

On Thu, Aug 21, 2008 at 7:58 PM, jason kirtland [EMAIL PROTECTED] wrote:


 Thanks for the traceback.  Give r5050 a try.

 Cheers,
 Jason


 Harish K Vishwanath wrote:
  Hello Michael,
 
  Thanks for your input! I got the latest trunk from SVN.
 
  However, if my app specific baseclass is an old style class, it still
  breaks., this time in orm\attributes.py
 
  Traceback (most recent call last):
File SqlDB_Test.py, line 9, in ?
  dbo = SqlDB(SqlDB_Test.Sqlite,c:\\testdbs)
File d:\recogsys\src\python\RSITerm\SQLConvert\SqlDB.py, line 77, in
  __init_
  _
  self.initSetup(echo)
File d:\recogsys\src\python\RSITerm\SQLConvert\SqlDB.py, line 115,
  in initSe
  tup
  elixir.setup_all(True)
File d:\recogsys\src\python\rsiterm\__init__.py, line 145, in
 setup_all
 
File
  c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
  line 816, in setup_entities
File
  c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
  line 409, in setup_mapper
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
  qlalchemy\orm\__init__.py, line 643, in mapper
  return Mapper(class_, local_table, *args, **params)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
  qlalchemy\orm\mapper.py, line 197, in __init__
  self.__compile_class()
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
  qlalchemy\orm\mapper.py, line 852, in __compile_class
  manager = attributes.create_manager_for_cls(self.class_)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
  qlalchemy\orm\attributes.py, line 1494, in create_manager_for_cls
  manager = factory(class_)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
  qlalchemy\orm\attributes.py, line 1047, in __init__
  cls_state = manager_of_class(base)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta4dev_r5048-py2.4.egg\s
  qlalchemy\orm\attributes.py, line 1511, in manager_of_class
  finder = self.manager_finders[cls]
File C:\Python24\lib\weakref.py, line 219, in __getitem__
  return self.data[ref(key)]
  TypeError: cannot create weak reference to 'classobj' object
 
  This error goes away when I make my app baseclass as a new style class.
  It is not giving any problems with Exceptions class in Py2.4 though.
 
  Could this be a possible issue?
 
  On Wed, Aug 20, 2008 at 9:28 PM, Michael Bayer [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
 
 
  On Aug 20, 2008, at 11:52 AM, Harish K Vishwanath wrote:
 
Hello,
   
Sorry if I am being stupid. I saw the ticket and r0535 and 537
changeset. Which version of SQLA incorporates these changesets?
 
 
  no worries...use the latest trunk, which will ultimately be released
  either as 0.5beta4 or 0.5.0. http://0.5.0.
 
 
 
 
 
 
 
  --
  Regards,
  Harish
 
  


 



-- 
Regards,
Harish

--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-20 Thread az

seems your baseclass is oldstyle class, not inheriting 'object'.
python 2.5 newstyle classes (off object) has that __subclasses__() 
classmethod (see dir(type)), not sure if 2.4 has that at all.
i've no idea where these are explained (as well as mro() and other 
type' stuff.)


i looked a bit at the src and i have a may be related question:
 why, once a instrumentation (descriptor) is installed on some class X 
attribute xyz, the same descriptor has to be installed on all 
subclasses of it?
getattr( some_subclass_of_X, 'xyz') would return it anyway?

if it is to allow diff subclasses to have diff. instrumentation, why 
it has to be triggered by the base class and not by mapper? 
and if that is because the subclass may have no mapper... what it has 
to do with SA then?

On Wednesday 20 August 2008 12:39:15 Harish K Vishwanath wrote:
 Hello,

 I was using elixir 0.5.2 (SQL Alchemy 0.4.6) on Py 2.4.

 All my model objects inherits from Entity as well as another
 baseobject specific to our application.

 class User(elixir.Entity, application.baseobject):
 ...
 ...

 It used to work fine.

 Today I upgraded to SQLA 0.5 beta3 and elixir 0.6.1. The same code
 doesn't work anymore.


   File c:\Python24\lib\site-
 packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
 line 816, in setup_entities
   File
 c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity
.py, line 409, in setup_mapper
   File
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
lchemy \orm\__init__.py, line 623, in mapper
 return Mapper(class_, local_table, *args, **params)
   File
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
lchemy \orm\mapper.py, line 196, in __init__
 self.__compile_class()
   File
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
lchemy \orm\mapper.py, line 844, in __compile_class
 manager = attributes.create_manager_for_cls(self.class_)
   File
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
lchemy \orm\attributes.py, line 1498, in create_manager_for_cls
 existing_factories = collect_management_factories_for(class_)
   File
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
lchemy \orm\attributes.py, line 1604, in
 collect_management_factories_for hierarchy =
 util.class_hierarchy(cls)
   File
 c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
lchemy \util.py, line 408, in class_hierarchy
 for s in [_ for _ in c.__subclasses__() if _ not in hier]:
 AttributeError: class IRObject has no attribute '__subclasses__'

 IRObject is our app specific base class.

 Any ideas?
 Thanks,
 Harish

 


--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-20 Thread Harish K Vishwanath
Hello,

I changed my baseclass to Inherit from object and made it as a new class.

Now it dies in trying to find hierarchy for built-in class
exception.Exception.

AttributeError: class Exception has no attribute '__subclasses__'

In Py 2.5, Exceptions have been changed to new style classes, but it doesn't
seem to be so in py 2.4.

Is there a way to bypass this assumption of SA?

Thanks,
Harish


On Wed, Aug 20, 2008 at 4:02 PM, [EMAIL PROTECTED] wrote:


 seems your baseclass is oldstyle class, not inheriting 'object'.
 python 2.5 newstyle classes (off object) has that __subclasses__()
 classmethod (see dir(type)), not sure if 2.4 has that at all.
 i've no idea where these are explained (as well as mro() and other
 type' stuff.)


 i looked a bit at the src and i have a may be related question:
  why, once a instrumentation (descriptor) is installed on some class X
 attribute xyz, the same descriptor has to be installed on all
 subclasses of it?
 getattr( some_subclass_of_X, 'xyz') would return it anyway?

 if it is to allow diff subclasses to have diff. instrumentation, why
 it has to be triggered by the base class and not by mapper?
 and if that is because the subclass may have no mapper... what it has
 to do with SA then?

 On Wednesday 20 August 2008 12:39:15 Harish K Vishwanath wrote:
  Hello,
 
  I was using elixir 0.5.2 (SQL Alchemy 0.4.6) on Py 2.4.
 
  All my model objects inherits from Entity as well as another
  baseobject specific to our application.
 
  class User(elixir.Entity, application.baseobject):
  ...
  ...
 
  It used to work fine.
 
  Today I upgraded to SQLA 0.5 beta3 and elixir 0.6.1. The same code
  doesn't work anymore.
 
 
File c:\Python24\lib\site-
  packages\elixir-0.6.1-py2.4.egg\elixir\entity.py,
  line 816, in setup_entities
File
  c:\Python24\lib\site-packages\elixir-0.6.1-py2.4.egg\elixir\entity
 .py, line 409, in setup_mapper
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
 lchemy \orm\__init__.py, line 623, in mapper
  return Mapper(class_, local_table, *args, **params)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
 lchemy \orm\mapper.py, line 196, in __init__
  self.__compile_class()
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
 lchemy \orm\mapper.py, line 844, in __compile_class
  manager = attributes.create_manager_for_cls(self.class_)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
 lchemy \orm\attributes.py, line 1498, in create_manager_for_cls
  existing_factories = collect_management_factories_for(class_)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
 lchemy \orm\attributes.py, line 1604, in
  collect_management_factories_for hierarchy =
  util.class_hierarchy(cls)
File
  c:\python24\lib\site-packages\SQLAlchemy-0.5.0beta3-py2.4.egg\sqla
 lchemy \util.py, line 408, in class_hierarchy
  for s in [_ for _ in c.__subclasses__() if _ not in hier]:
  AttributeError: class IRObject has no attribute '__subclasses__'
 
  IRObject is our app specific base class.
 
  Any ideas?
  Thanks,
  Harish
 
 


 



-- 
Regards,
Harish

--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-20 Thread Michael Bayer

On Aug 20, 2008, at 5:39 AM, Harish K Vishwanath wrote:

 Hello,

 I was using elixir 0.5.2 (SQL Alchemy 0.4.6) on Py 2.4.

 All my model objects inherits from Entity as well as another  
 baseobject specific to our application.

 class User(elixir.Entity, application.baseobject):
 ...
 ...

 It used to work fine.

 Today I upgraded to SQLA 0.5 beta3 and elixir 0.6.1. The same code  
 doesn't work anymore.

when using SQLA betas, keep your eye on the SVN timeline.   This issue  
is ticket 1078 and has been fixed in r5037.


--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-20 Thread Michael Bayer


On Aug 20, 2008, at 6:32 AM, [EMAIL PROTECTED] wrote:


 seems your baseclass is oldstyle class, not inheriting 'object'.
 python 2.5 newstyle classes (off object) has that __subclasses__()
 classmethod (see dir(type)), not sure if 2.4 has that at all.
 i've no idea where these are explained (as well as mro() and other
 type' stuff.)


 i looked a bit at the src and i have a may be related question:
 why, once a instrumentation (descriptor) is installed on some class X
 attribute xyz, the same descriptor has to be installed on all
 subclasses of it?
 getattr( some_subclass_of_X, 'xyz') would return it anyway?

if you look closely you'll see that the InstrumentedAttribute has  
state which is specific to the actual mapper in use.   Try commenting  
it out and see which tests break (theres a few for that specifically).

 if it is to allow diff subclasses to have diff. instrumentation, why
 it has to be triggered by the base class and not by mapper?
 and if that is because the subclass may have no mapper... what it has
 to do with SA then?

mostly with construction of expressions, like Cls.foobar == 5 types of  
things.


--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-20 Thread Harish K Vishwanath
Hello,

Sorry if I am being stupid. I saw the ticket and r0535 and 537 changeset.
Which version of SQLA incorporates these changesets?

On Wed, Aug 20, 2008 at 7:15 PM, Michael Bayer [EMAIL PROTECTED]wrote:


 On Aug 20, 2008, at 5:39 AM, Harish K Vishwanath wrote:

 Hello,

 I was using elixir 0.5.2 (SQL Alchemy 0.4.6) on Py 2.4.

 All my model objects inherits from Entity as well as another baseobject
 specific to our application.

 class User(elixir.Entity, application.baseobject):
 ...
 ...

 It used to work fine.

 Today I upgraded to SQLA 0.5 beta3 and elixir 0.6.1. The same code doesn't
 work anymore.


 when using SQLA betas, keep your eye on the SVN timeline.   This issue is
 ticket 1078 and has been fixed in r5037.


 



-- 
Regards,
Harish

--~--~-~--~~~---~--~~
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: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-20 Thread Michael Bayer


On Aug 20, 2008, at 11:52 AM, Harish K Vishwanath wrote:

 Hello,

 Sorry if I am being stupid. I saw the ticket and r0535 and 537  
 changeset. Which version of SQLA incorporates these changesets?


no worries...use the latest trunk, which will ultimately be released  
either as 0.5beta4 or 0.5.0.



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