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

Use the new ContextMixin from Django 1.5 #27

Merged
merged 1 commit into from Nov 26, 2012

Conversation

dekkers
Copy link
Contributor

@dekkers dekkers commented Nov 23, 2012

Django 1.5 introduces the ContextMixin to solve problems with multiple mixins defining get_context_data. It also sets the 'view' variable that points to the View which is quite handy. For more information, see the documentation: https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-simple/#contextmixin and the ticket that introduced it: https://code.djangoproject.com/ticket/16074

This patch adds support for using ContextMixin. I also modified the get_context_data methods to be all in the same style as the mixins in Django 1.5, so that it is clear what is going on and overriding variables will always work in the same way.

For earlier Django versions I added our own version of ContextMixin. I tested with both 1.4 and 1.5 and all tests pass with both versions.

AndrewIngram added a commit that referenced this pull request Nov 26, 2012
Use the new ContextMixin from Django 1.5
@AndrewIngram AndrewIngram merged commit d8c627c into AndrewIngram:master Nov 26, 2012
@AndrewIngram
Copy link
Owner

Thanks for this. I'll need to do the same for dates.py (which isn't covered by any tests yet).

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