r13587 - ArchGenXML/trunk/src/archgenxml

"Thomas Desvenain" <[email protected]> Thu, 14 Apr 2011 22:02:07 +0000
Newsgroups gmane.comp.web.zope.plone.archetypes.cvs
Message-ID <[email protected]>
Author: thomasdesvenain
Date: Thu Apr 14 22:02:07 2011
New Revision: 13587

Modified:
   ArchGenXML/trunk/src/archgenxml/ArchetypesGenerator.py
Log:
Plone 4.0+ ReferenceBrowserWidget import

Modified: ArchGenXML/trunk/src/archgenxml/ArchetypesGenerator.py
==============================================================================
--- ArchGenXML/trunk/src/archgenxml/ArchetypesGenerator.py	(original)
+++ ArchGenXML/trunk/src/archgenxml/ArchetypesGenerator.py	Thu Apr 14 22:02:07 2011
@@ -273,7 +273,11 @@
 
         # Check for necessity to import ReferenceBrowserWidget
         if self.getReferenceFieldSpecs(element):
-            print >>out, \
+            if self.getOption('plone_target_version', element.getPackage(), 3.0) >= 4.0:
+                print >>out, 'from archetypes.referencebrowserwidget.widget' + \
+                         ' import ReferenceBrowserWidget'
+            else:
+                print >>out, \
                   'from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget'+\
                          ' import \\\n    ReferenceBrowserWidget'
 

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev