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

Eradicate use of c.pkg #2132

Closed
rossjones opened this issue Dec 9, 2014 · 2 comments
Closed

Eradicate use of c.pkg #2132

rossjones opened this issue Dec 9, 2014 · 2 comments

Comments

@rossjones
Copy link
Contributor

c.pkg is the most user occurring instance of sqlalchemy models being passed to the templates alongside pkg_dict. Persuading everyone to stop using c in extensions would take a very long time, but at least we can remove the Package model from the context passed to the template. We can then stop package_show stuffing the Package model into the context that it was passed.

This would be a breaking change, so perhaps some notice in an upcoming version and then removal in the next would be a good approach.

@rossjones
Copy link
Contributor Author

It looks like removing the package from the context will be problematic in resource_create

    ## Get out resource_id resource from model as it will not appear in
    ## package_show until after commit
    upload.upload(context['package'].resources[-1].id,
                  uploader.get_max_resource_size())

@davidread
Copy link
Contributor

General agreement - let's pick this off as we come across it.

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

No branches or pull requests

3 participants