From 2a83536055b357f319153c4038176acb345e08e6 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Fri, 14 Aug 2015 14:51:40 +0200 Subject: [PATCH] (Multi|)RelationField: Cleanup imports. --- product/ERP5Form/MultiRelationField.py | 5 +---- product/ERP5Form/RelationField.py | 13 +------------ 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/product/ERP5Form/MultiRelationField.py b/product/ERP5Form/MultiRelationField.py index b26a419307..89964fa491 100644 --- a/product/ERP5Form/MultiRelationField.py +++ b/product/ERP5Form/MultiRelationField.py @@ -35,11 +35,9 @@ from Products.PythonScripts.Utility import allow_class from Products.ERP5Type.Message import translateString from AccessControl import ClassSecurityInfo from types import StringType -from zLOG import LOG from Products.Formulator.DummyField import fields from Products.ERP5Type.Globals import get_request -from AccessControl import Unauthorized -from AccessControl import getSecurityManager +import json # Max. number of catalog result MAX_SELECT = 30 @@ -369,7 +367,6 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, only erp5_autocompletion_ui bt5 to be installed """ # XXX: Allow to specify more parameters to jquery-ui autocomplete widget? - import json return """ <script type="text/javascript"> $(document).ready(function() { diff --git a/product/ERP5Form/RelationField.py b/product/ERP5Form/RelationField.py index 0128eefa28..dfa014b12a 100644 --- a/product/ERP5Form/RelationField.py +++ b/product/ERP5Form/RelationField.py @@ -29,19 +29,10 @@ from Products.Formulator import Widget, Validator from Products.Formulator.Field import ZMIField -from Products.Formulator.DummyField import fields -from Products.ERP5Type.Utils import convertToUpperCase -from Products.CMFCore.utils import getToolByName from Products.PythonScripts.Utility import allow_class -from Products.ERP5Type.Message import Message from Products.ERP5Form import MultiRelationField -from Products.ERP5Form.MultiRelationField import MAX_SELECT, \ - NEW_CONTENT_PREFIX, \ - SUB_FIELD_ID, ITEM_ID, \ - NO_VALUE -from types import StringType +from Products.ERP5Form.MultiRelationField import SUB_FIELD_ID, ITEM_ID from AccessControl import ClassSecurityInfo -from zLOG import LOG class RelationStringFieldWidget( MultiRelationField.MultiRelationStringFieldWidget): @@ -58,8 +49,6 @@ class RelationStringFieldWidget( default = Widget.TextWidget.default def _generateRenderValueList(self, field, key, value, REQUEST): -# value = value or NO_VALUE - if REQUEST.get( 'read_only_%s' % REQUEST.get( 'field__proxyfield_%s_%s_default' % (field.id, field._p_oid), -- 2.30.9