Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNO-177-add-view-with-specified-fields #300

Merged
merged 16 commits into from
Oct 28, 2020

Conversation

keenangraham
Copy link
Contributor

No description provided.

@@ -244,8 +244,9 @@ def item_view_audit(context, request):
path = request.resource_path(context)
properties = request.embed(path, '@@object')
inherit = context.audit_inherit
if context.embedded and '*' in context.audit_inherit:
inherit = context.embedded
embedded_paths = list(context.embedded) + [p.path for p in context.embedded_with_frame]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple places where we have to iterate over these paths. Think I could make this cleaner by just having a property that implements this logic once instead of leaking internals every time we have to do this.

@@ -244,8 +244,9 @@ def item_view_audit(context, request):
path = request.resource_path(context)
properties = request.embed(path, '@@object')
inherit = context.audit_inherit
if context.embedded and '*' in context.audit_inherit:
inherit = context.embedded
embedded_paths = list(context.embedded) + [p.path for p in context.embedded_with_frame]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does context.embedded_with_frame raise an exception if the context doesn't have it set?

Copy link
Collaborator

@pedrohr pedrohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@keenangraham
Copy link
Contributor Author

keenangraham commented Oct 27, 2020

Shouldn't have any functional change, put embedded and embedded_with_frame iteration logic in embedded_paths @classmethod (couldn't use @property because TypeInfo only interacts with class, not instance).

@keenangraham keenangraham force-pushed the SNO-177-add-view-with-specified-fields branch from 756b156 to a72053a Compare October 27, 2020 19:52
@keenangraham keenangraham merged commit b2d14bc into dev Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants