Commit 7d1689c3 authored by Arnaud Fontaine's avatar Arnaud Fontaine

py3: has_key().

parent d25efe94
......@@ -17,7 +17,7 @@ WHERE
INSERT INTO predicate_category VALUES
<dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')">
<dtml-if "'membership_criterion_category_list' in predicate_property_dict[loop_item]">
<dtml-let uid_list="portal_categories.CategoryTool_getPreferredPredicateCategoryParentUidItemList(predicate_property_dict[loop_item]['membership_criterion_category_list'], getObject[loop_item])">
<dtml-if uid_list>
<dtml-in "uid_list">
......
......@@ -8,7 +8,7 @@
render_prefix render_prefix | nothing;
key_prefix key_prefix | nothing;
field_errors python: request.get('field_errors', {});
field_has_error python: field_errors.has_key(field_id);
field_has_error python: field_id in field_errors;
global form_id form_id | form/id | nothing;
field_description field/Field_getDescription;
is_web_mode is_web_mode | nothing">
......
......@@ -48,7 +48,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
</tr>
<dtml-in propertyMap mapping>
<dtml-let type="not _.has_key('type') and 'string' or type">
<dtml-let type="'type' not in _ and 'string' or type">
<tr>
<td align="left" valign="top" width="16">
<dtml-if "'d' in _['sequence-item'].get('mode', 'awd')">
......@@ -105,7 +105,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
</dtml-in>
</select>
</div>
<dtml-elif "_.has_key('select_variable')">
<dtml-elif "'select_variable' in _">
<div class="form-element">
<select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">text">
<dtml-in "_[select_variable]">
......@@ -135,7 +135,7 @@ property values, edit the values and click &quot;Save Changes&quot;.
</dtml-in>
</select>
</div>
<dtml-elif "_.has_key('select_variable')">
<dtml-elif "'select_variable' in _">
<div class="form-element">
<select name="&dtml-id;:<dtml-var "REQUEST['management_page_charset_tag']">list:string" multiple
size="<dtml-var "_.min(7, _.len(_[select_variable]))">">
......
......@@ -271,7 +271,7 @@ def allow_full_write(t):
This supports both RestrictedPython-3.6.0, where the safetype is implemented as:
safetype = {dict: True, list: True}.has_key
safetype = {dict: True, list: True}.__contains__
...
safetype(t)
......
......@@ -44,7 +44,7 @@ def reorderPickle(jar, p):
def persistent_load(ooid,
Ghost=Ghost,
oids=oids, wrote_oid=oids.has_key,
oids=oids, wrote_oid=oids.__contains__,
new_oid=storage.new_oid):
"Remap a persistent id to an existing ID and create a ghost for it."
......
......@@ -1645,7 +1645,7 @@ class Catalog(Folder,
This function return a list of ids.
"""
ids={}
have_id=ids.has_key
have_id=ids.__contains__
while self is not None:
if hasattr(self, 'objectValues'):
......
......@@ -1094,7 +1094,7 @@ class ZCatalog(Folder, Persistent, Implicit):
"Return list of valid roles"
obj=self
dict={}
dup =dict.has_key
dup =dict.__contains__
x=0
while x < 100:
if hasattr(obj, '__ac_roles__'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment