{ "info": { "author": "Sigma Education", "author_email": "dev@sigmaeducation.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-mashup\n=============\n\ndjango-mashup is a view masher for the Django Framework. Combine multiple views, templates, and/or Ajax loaded urls into a single class-based view.\n\nWrap those views in template-based containers.\n\nDefine different combinations of views and/or containers for different request types.\n\nInstallation\n===============\n\nInstall the module in your Python distribution or virtualenv::\n\n $ pip install git+https://github.com/SigmaEducation/django-mashup.git\n\nAdd the application to your `INSTALLED_APPS`::\n\n```\n INSTALLED_APPS = (...\n \"mashup\",\n ...\n )\n```\n\nUse\n===\n\ndjango-mashup provides one view class:\n\n from mashup.views import MashUp\n \nand three component classes:\n\n from mashup.views import URLMash, TemplateMash, ViewMash\n \nExample:\n\n``` \n from django.core.urlresolvers import reverse\n from mashup.views import MashUp, URLMash, TemplateMash\n \n class MyMashup(MashUp):\n views = [TemplateMash(\"my_app/my_login_instructions.html\"),\n URLMash(reverse('account:login')),\n ]\n \n # my_app/my_login_instructions.html\n \n
Use the following form to log in.
\n```\n\nHere's an example that mashes a view with HTML:\n\n``` \n from django.views.generic.edit import FormView\n from mashup.views import MashUp, TemplateMash, ViewMash\n \n class MyFormView(FormView):\n ...\n \n class MyMashup(MashUp):\n views = [TemplateMash(\"my_app/my_login_instructions.html\"),\n ViewMash(MyFormView),\n ]\n```\n\nEach component class takes an optional container keyword argument. This should be a template name. Use '{{ mashup|safe }}' to specify where the content should be placed:\n\n``` \n from django.core.urlresolvers import reverse\n from mashup.views import MashUp, URLMash, TemplateMash\n \n class MyMashup(MashUp):\n views = [TemplateMash(\"my_app/my_login_instructions.html\",\n container=\"my_app/my_template.html\"),\n URLMash(reverse('account:login')),\n \n ...\n \n # my_app/my_template.html\n \n