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

Add app to product context #277

Merged
merged 4 commits into from May 17, 2018

Conversation

Projects
None yet
2 participants
@rbu
Member

rbu commented May 17, 2018

Products receive the ProductContext as the first parameter
to their initialize() method when they are loaded. This context used to
contain a reference to the app until it was removed during Zope 4
preparations. The Application was, however, never exposed through an
API.

Access to the API is necessary for certain products that automatically
add objects to the Application when they are loaded, such as the
Products.Sessions and Products.TemporaryFolder. This used to happen in
OFS.Application in Zope 2, but was moved out when the products became
indepentent.

@rbu rbu requested a review from icemac May 17, 2018

rbu added some commits May 16, 2018

Hand Application object to Products through ProductContext
Products receive the ProductContext as the first parameter
to their initialize() method when they are loaded. This context used to
contain a reference to the app until it was removed during Zope 4
preparations. The Application was, however, never exposed through an
API.

Access to the API is necessary for certain products that automatically
add objects to the Application when they are loaded, such as the
Products.Sessions and Products.TemporaryFolder. This used to happen in
OFS.Application in Zope 2, but was moved out when the products became
indepentent.
@icemac

icemac approved these changes May 17, 2018

LGTM. Additionally an entry in the change log would be helpful.

app = context.getApplication()
folder = Folder('some_older')
app._setObject('some_folder', folder)

This comment has been minimized.

@icemac

icemac May 17, 2018

Member

Is there a reason why the names are different? (some_older vs. some_folder)

@rbu

This comment has been minimized.

Member

rbu commented May 17, 2018

Fixed the typo and added a changelog entry

@rbu

This comment has been minimized.

Member

rbu commented May 17, 2018

@icemac ping

@icemac

This comment has been minimized.

Member

icemac commented May 17, 2018

@rbu Feel free to merge the PR.

@rbu rbu merged commit ba9bee7 into master May 17, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.3%) to 78.862%
Details

@rbu rbu deleted the add_app_to_product_context branch May 17, 2018

@icemac icemac added this to the 4.0b5 milestone May 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment