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

Partition IDs based on their Parent Analysis Request #1228

Merged
merged 3 commits into from Feb 6, 2019

Conversation

2 participants
@xispa
Copy link
Contributor

commented Feb 5, 2019

Description of the issue/feature this PR addresses

This Pull Request makes the IDs of Partitions to be based on their parent Analysis Request (their primary Sample). Same approach could be used for Secondary ARs.

captura de pantalla de 2019-02-05 19-09-59

Current behavior before PR

Partition IDs do not resemble to their primary samples

Desired behavior after PR is merged

Partition IDs have the following format by default <primary-ar>-00, where the last digit is a counter.

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

xispa added some commits Feb 5, 2019

Fix Traceback in number generator view (ng)
A Traceback was raised because of the new keywords in ID server
(parent_analysisrequest, parent_ar_id) as well as because "alpha"
was not yet there.

@xispa xispa requested a review from ramonski Feb 5, 2019

"""
portal_type = kw.get("portal_type") or api.get_portal_type(context)
if IAnalysisRequestPartition.providedBy(context):
portal_type = "{}Partition".format(portal_type)

This comment has been minimized.

Copy link
@ramonski

ramonski Feb 6, 2019

Contributor

Allow overriding from the passed in keywords also for Partitions.
The precedence would be then

  1. Portal Type
  2. Interface Lookup
  3. Keyword override

This comment has been minimized.

Copy link
@xispa

xispa Feb 6, 2019

Author Contributor

Not sure if I understand correctly. You mean to override kw's value for "portal_type" when the context is a IAnalysisRequestPartition?

This comment has been minimized.

Copy link
@ramonski

ramonski Feb 6, 2019

Contributor

Yes exactly. If the user provided portal_type=foo, it should overrule the portal_type and even the fact that IAnalysisRequestPartition is provided by the context

@ramonski ramonski merged commit 5582ccb into master Feb 6, 2019

3 checks passed

Scrutinizer Analysis: 2 updated code elements – Tests: passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ramonski ramonski deleted the idserver-partitions branch Feb 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.