#2057: 1.0.7 breaks SA 0.3 compatibility
------------------------+---------------------------------------------------
 Reporter:  gsakkis     |       Owner:  faide
     Type:  defect      |      Status:  new  
 Priority:  normal      |   Milestone:  1.1  
Component:  TurboGears  |     Version:  1.0.7
 Severity:  normal      |    Keywords:       
------------------------+---------------------------------------------------
 I am migrating an app from 1.0.2.2 to 1.0.7 and I hit a NameError on
 commands/sacommand.py; the reason is sqlalchemy.Text and
 sqlalchemy.UnicodeText were added in SA 0.4. The docs claim that
 "TurboGears 1.0.4 and newer supports both SA 0.4 and 0.3 (requiring at
 least 0.3.10).", so either the docs or the code is wrong. Below is a
 minimal fix; feel free to make it cleaner if necessary.

 {{{
 --- sacommand.py
 +++ TurboGears-1.0.7-py2.5.egg/turbogears/command/sacommand.py
 @@ -3,10 +3,14 @@
  from turbogears.util import get_model
  try:
      from sqlalchemy import MetaData, exceptions, Table
 -    from sqlalchemy import String, Unicode, Text, UnicodeText
 +    from sqlalchemy import String, Unicode
      from turbogears.database import metadata, get_engine
  except ImportError:
      pass
 +try: # not available in 0.3
 +    from sqlalchemy import Text, UnicodeText
 +except ImportError:
 +    UnicodeText = Text = type(None)

  [dispatch.generic()]
  def sacommand(command, args):
 }}}

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2057>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to