← Back to team overview

caneypuggies team mailing list archive

Problem using SQLAlchemy column_property: AttributeError: '_Label' object has no attribute 'info'

 

You'll need to implement this fix in your own virtualenvironment (in the
tg21env folder) to be able to continue using the Reformed Churches
Locator admin page, where you can add new congregations.  I sent my
recommended fix to the creator of sprox, which is where the bug was (if
the bug is sprox's fault).  The way to implement the fix in your code is
to open saormprovider.py and replace the line (#148) that has a minus
sign in front of it below with the line that has the plus sign in front
of it.

Tim

-------- Original Message --------
Subject: 	Re: Problem using SQLAlchemy column_property: AttributeError:
'_Label' object has no attribute 'nullable'
Date: 	Wed, 15 Dec 2010 13:24:58 -0800 (PST)
From: 	timblack1 <timblack1@xxxxxxxxx>
Reply-To: 	sprox@xxxxxxxxxxxxxxxx
To: 	sprox@xxxxxxxxxxxxxxxx



Using this code:

    num_congs = column_property(
                                select(
                                   [func.count(id)], 
                                   and_(
                                        cong_cgroup.c.cgroup_id==id, 
                                      
 cong_cgroup.c.cong_id==Congregation.id
                                        )
                                   ).label('num_congs')
                               )

I got a similar error:

File
'/home/tim/Documents/MyWebPages/CaneyPUGgies/code/trunk/tg21env/lib/python2.6/site-packages/sprox-0.6.10-py2.6.egg/sprox/saormprovider.py',
line 149 in _find_title_column
  if 'title' in column.info and column.info['title']:
AttributeError: '_Label' object has no attribute 'info'

Which I fixed like this:

=== modified file
'lib/python2.6/site-packages/sprox-0.6.10-py2.6.egg/sprox/saormprovider.py'
---
lib/python2.6/site-packages/sprox-0.6.10-py2.6.egg/sprox/saormprovider.py2010-12-08
23:35:13 +0000
+++
lib/python2.6/site-packages/sprox-0.6.10-py2.6.egg/sprox/saormprovider.py2010-12-15
21:20:12 +0000
@@ -145,7 +145,7 @@
 
     def _find_title_column(self, entity):
         for column in class_mapper(entity).columns:
-            if 'title' in column.info and column.info['title']:
+            if type(column).__name__!='_Label' and 'title' in
column.info and column.info['title']:
                 return column.key
         return None
 
Is this the right way to fix this error?
-- 
You received this message because you are subscribed to the Google
Groups "sprox" group.
To post to this group, send email to sprox@xxxxxxxxxxxxxxxx.
To unsubscribe from this group, send email to
sprox+unsubscribe@xxxxxxxxxxxxxxxx.
For more options, visit this group at
http://groups.google.com/group/sprox?hl=en.