{ "info": { "author": "Maykin Media", "author_email": "support@maykinmedia.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "\nDjango CMS Export Page\n=================================================\n\n:Version: 0.1.0\n:Source: https://bitbucket.org/maykinmedia/djangocms-export-page\n:Keywords: ``django`` ``cms`` ``export`` ``docx``\n:PythonVersion: 3.4\n\n|build-status| |requirements| |coverage|\n\n|python-versions| |django-versions| |pypi-version|\n\nExport a Django CMS page or a model view to a DOCX document\n\n.. contents::\n\n.. section-numbering::\n\nFeatures\n========\n\n* Adds a menu entry in the CMS toolbar to export the current page\n* Ability to export a custom model, including placeholder fields\n\n.. image:: img/page-export-menu.png\n\nInstallation\n============\n\nRequirements\n------------\n\n* Python 3.4 or above\n* setuptools 30.3.0 or above\n* Django 1.11 or above\n* Django CMS 3.4.6 or above\n\n\nInstall\n-------\n\n.. code-block:: bash\n\n pip install djangocms-export-page\n\n\nUsage\n=====\n\nIn your Django settings:\n\n.. code-block:: python\n\n INSTALLED_APPS = [\n ...\n 'djangocms_export_page',\n ...\n ]\n\n\n\nCMS Page\n--------\n\nCMS Page don't need any extra configuration to work.\n\nIf a Plugin has a reverse ForeignKey that would behave like children,\nadd the following to the CMSPlugin model class:\n\n.. code-block:: python\n\n _export_page = {\n 'children': 'items'\n }\n\n @property\n def items(self):\n return self.frequentlyaskedquestion_set.all()\n\nwhere `items` is a iterable attribute of the model class.\n\nAnd for on the ForeignKey Django model class:\n\n.. code-block:: python\n\n _export_page = {\n 'fields': ['name', ... ]\n }\n\nIf you want to export the contents of a ForeignKey or OneToOneField inside the regular model you can use\n`_export_page_field_names`. Now these fields will be put in the some level as the plugin fields.\n\n.. code-block:: python\n\n _export_page_field_names = ['number', 'title', 'lead', 'display_date', 'date', 'location']\n\n\nDjango Model\n------------\n\nIf you need to export a Django model included in a AppHook,\nadd the following to the model class:\n\n.. code-block:: python\n\n _export_page = {\n 'sections': [{\n 'name': 'Meta',\n 'fields': ['title', ... ]\n }, {\n 'name': 'Body',\n 'fields': ['content']\n }],\n }\n\nIt's better to put the PlaceholderField (here `content`) in a separate section.\n\n\nStatic Placeholders\n-------------------\n\nIf you also want to export the static placeholders of a page, some extra configuration\nis required. There is a setting called `EXPORT_STATIC_PLACEHOLDERS`.\n\n.. code-block:: python\n\n EXPORT_STATIC_PLACEHOLDERS = {\n 'template_name': ['static_placeholder_code']\n }\n\nSo with the cms settings it will look like this:\n\n.. code-block:: python\n\n # test.html\n