Update MultiFormView CBV to work with Django 1.9.x

This commit is contained in:
Roberto Rosario
2016-11-14 01:44:47 -04:00
parent 3663521899
commit a5a6afe240
5 changed files with 20 additions and 3 deletions

View File

@@ -6,6 +6,12 @@
- Remove dependency on the django-filetransfer library
- Fix height calculation in resize transformation
- Improve upgrade instructions
- New image caching pipeline
- New drop down menus for the documents, folders and tags app as well as for
the user links
- New Dashboard view
- Moved licenses to their own module in every app
- Update project to work with Django 1.9.11
2.1.5 (2016-11-08)
==================

View File

@@ -21,6 +21,7 @@ Other changes
the user links
- Dashboard
- Moved licenses to their own module in every app
- Update project to work with Django 1.9.11
Removals
--------

View File

@@ -10,7 +10,7 @@ from django.views.generic import (
)
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.edit import (
CreateView, DeleteView, ModelFormMixin, UpdateView
CreateView, DeleteView, FormMixin, ModelFormMixin, UpdateView
)
from django.views.generic.list import ListView
@@ -207,6 +207,16 @@ class MultiFormView(DjangoFormView):
form = klass(**form_kwargs)
return form
def get_context_data(self, **kwargs):
"""
Insert the form into the context dict.
"""
if 'forms' not in kwargs:
kwargs['forms'] = self.get_forms(
form_classes=self.get_form_classes()
)
return super(FormMixin, self).get_context_data(**kwargs)
def get_forms(self, form_classes):
return dict(
[

View File

@@ -1,2 +1,2 @@
-r base.txt
Django==1.8.15
Django==1.9.11

View File

@@ -56,7 +56,7 @@ def find_packages(directory):
return packages
install_requires = """
Django==1.8.15
Django==1.9.11
Pillow==3.1.2
PyYAML==3.11
celery==3.1.19