Skip to content

Commit

Permalink
[fc] Repository: plone.app.contenttypes
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2019-03-26T16:42:12+01:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.contenttypes@83d2b29

Add content-core macro to summary_view.pt

Files changed:
A news/514.bugfix
M plone/app/contenttypes/browser/templates/listing_summary.pt
Repository: plone.app.contenttypes

Branch: refs/heads/master
Date: 2019-04-01T15:27:24+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.contenttypes@10d7e16

Merge pull request #515 from plone/issue_514

Add content-core macro to summary_view.pt

Files changed:
A news/514.bugfix
M plone/app/contenttypes/browser/templates/listing_summary.pt
  • Loading branch information
jensens committed Apr 1, 2019
1 parent db326eb commit a1454fe
Showing 1 changed file with 16 additions and 34 deletions.
50 changes: 16 additions & 34 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,34 @@
Repository: plone.dexterity
Repository: plone.app.contenttypes


Branch: refs/heads/master
Date: 2019-03-29T21:40:32+01:00
Author: Gil Forcada (gforcada) <gil.gnome@gmail.com>
Commit: https://github.com/plone/plone.dexterity/commit/4cab6b29a76a445efdb91cf4e5472daf0bef6824
Date: 2019-03-26T16:42:12+01:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: https://github.com/plone/plone.app.contenttypes/commit/83d2b29b012cd15ab0d5f94ca40a4e8b932b7191

feat: ignore more attribute names

This is mostly an optimization, see the rationale at the linked issue.

Fixes https://github.com/plone/plone.dexterity/issues/98

Files changed:
M plone/dexterity/content.py

b'diff --git a/plone/dexterity/content.py b/plone/dexterity/content.py\nindex 3cb25ad..c177aa6 100644\n--- a/plone/dexterity/content.py\n+++ b/plone/dexterity/content.py\n@@ -56,6 +56,14 @@\n FLOOR_DATE = DateTime(1970, 0) # always effective\n CEILING_DATE = DateTime(2500, 0) # never expires\n \n+# see comment in DexterityContent.__getattr__ method\n+ATTRIBUTE_NAMES_TO_IGNORE = (\n+ \'_v__providedBy__\',\n+ \'im_self\', # python 2 only, on python 3 it was renamed to __self__\n+ \'aq_inner\',\n+ \'_Access_contents_information_Permission\'\n+)\n+\n \n def _default_from_schema(context, schema, fieldname):\n """helper to lookup default value of a field\n@@ -331,7 +339,9 @@ def __getattr__(self, name):\n # wouldn\'t be in here if the class had such an attribute\n # defined).\n # also handle special dynamic providedBy cache here.\n- if name.startswith(\'__\') or name == \'_v__providedBy__\':\n+ # Ignore also some other well known names like\n+ # Acquisition and AccessControl related ones.\n+ if name.startswith(\'__\') or name in ATTRIBUTE_NAMES_TO_IGNORE:\n raise AttributeError(name)\n \n # attribute was not found; try to look it up in the schema and return\n'

Repository: plone.dexterity


Branch: refs/heads/master
Date: 2019-03-29T21:40:32+01:00
Author: Gil Forcada (gforcada) <gil.gnome@gmail.com>
Commit: https://github.com/plone/plone.dexterity/commit/a8cc9c9ce2165f4ca8a1485f78bc571ab35ad6b3

Add news entry
Add content-core macro to summary_view.pt

Files changed:
A news/98.feature
A news/514.bugfix
M plone/app/contenttypes/browser/templates/listing_summary.pt

b'diff --git a/news/98.feature b/news/98.feature\nnew file mode 100644\nindex 0000000..847883f\n--- /dev/null\n+++ b/news/98.feature\n@@ -0,0 +1,2 @@\n+Avoid expensive lookups for other common attributes.\n+[gforcada]\n'
b'diff --git a/news/514.bugfix b/news/514.bugfix\nnew file mode 100644\nindex 00000000..74e27a3d\n--- /dev/null\n+++ b/news/514.bugfix\n@@ -0,0 +1,2 @@\n+Add \'content-core\' macro definition to summary_view.pt so it can be reused\n+[petschki]\ndiff --git a/plone/app/contenttypes/browser/templates/listing_summary.pt b/plone/app/contenttypes/browser/templates/listing_summary.pt\nindex ddf660a4..0a923e35 100644\n--- a/plone/app/contenttypes/browser/templates/listing_summary.pt\n+++ b/plone/app/contenttypes/browser/templates/listing_summary.pt\n@@ -8,6 +8,8 @@\n <body>\n \n <metal:content-core fill-slot="content-core">\n+<metal:block define-macro="content-core">\n+\n <metal:block use-macro="context/@@listing_view/macros/content-core">\n \n <metal:entries fill-slot="entries">\n@@ -58,6 +60,8 @@\n </metal:block>\n </metal:entries>\n \n+</metal:block>\n+\n </metal:block>\n </metal:content-core>\n \n'

Repository: plone.dexterity
Repository: plone.app.contenttypes


Branch: refs/heads/master
Date: 2019-04-01T15:22:20+02:00
Date: 2019-04-01T15:27:24+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.dexterity/commit/e3749d290af7ce6f15506b7380a5c14453700f5b
Commit: https://github.com/plone/plone.app.contenttypes/commit/10d7e1691395b552043d0df02dacb1185eaf6880

Merge pull request #99 from plone/minor-optimization
Merge pull request #515 from plone/issue_514

Minor optimization
Add content-core macro to summary_view.pt

Files changed:
A news/98.feature
M plone/dexterity/content.py
A news/514.bugfix
M plone/app/contenttypes/browser/templates/listing_summary.pt

b'diff --git a/news/98.feature b/news/98.feature\nnew file mode 100644\nindex 0000000..847883f\n--- /dev/null\n+++ b/news/98.feature\n@@ -0,0 +1,2 @@\n+Avoid expensive lookups for other common attributes.\n+[gforcada]\ndiff --git a/plone/dexterity/content.py b/plone/dexterity/content.py\nindex 3cb25ad..c177aa6 100644\n--- a/plone/dexterity/content.py\n+++ b/plone/dexterity/content.py\n@@ -56,6 +56,14 @@\n FLOOR_DATE = DateTime(1970, 0) # always effective\n CEILING_DATE = DateTime(2500, 0) # never expires\n \n+# see comment in DexterityContent.__getattr__ method\n+ATTRIBUTE_NAMES_TO_IGNORE = (\n+ \'_v__providedBy__\',\n+ \'im_self\', # python 2 only, on python 3 it was renamed to __self__\n+ \'aq_inner\',\n+ \'_Access_contents_information_Permission\'\n+)\n+\n \n def _default_from_schema(context, schema, fieldname):\n """helper to lookup default value of a field\n@@ -331,7 +339,9 @@ def __getattr__(self, name):\n # wouldn\'t be in here if the class had such an attribute\n # defined).\n # also handle special dynamic providedBy cache here.\n- if name.startswith(\'__\') or name == \'_v__providedBy__\':\n+ # Ignore also some other well known names like\n+ # Acquisition and AccessControl related ones.\n+ if name.startswith(\'__\') or name in ATTRIBUTE_NAMES_TO_IGNORE:\n raise AttributeError(name)\n \n # attribute was not found; try to look it up in the schema and return\n'
b'diff --git a/news/514.bugfix b/news/514.bugfix\nnew file mode 100644\nindex 00000000..74e27a3d\n--- /dev/null\n+++ b/news/514.bugfix\n@@ -0,0 +1,2 @@\n+Add \'content-core\' macro definition to summary_view.pt so it can be reused\n+[petschki]\ndiff --git a/plone/app/contenttypes/browser/templates/listing_summary.pt b/plone/app/contenttypes/browser/templates/listing_summary.pt\nindex ddf660a4..0a923e35 100644\n--- a/plone/app/contenttypes/browser/templates/listing_summary.pt\n+++ b/plone/app/contenttypes/browser/templates/listing_summary.pt\n@@ -8,6 +8,8 @@\n <body>\n \n <metal:content-core fill-slot="content-core">\n+<metal:block define-macro="content-core">\n+\n <metal:block use-macro="context/@@listing_view/macros/content-core">\n \n <metal:entries fill-slot="entries">\n@@ -58,6 +60,8 @@\n </metal:block>\n </metal:entries>\n \n+</metal:block>\n+\n </metal:block>\n </metal:content-core>\n \n'

0 comments on commit a1454fe

Please sign in to comment.