{ "info": { "author": "Artur Barseghyan", "author_email": "artur.barseghyan@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "===================================\r\nsirep\r\n===================================\r\nAS OF 2015-01-01 THIS PACKAGE IS NO LONGER SUPPORTED!\r\n\r\nSimple report generation. Can be used to generate any kind of CSV or HTML reports. Instead of binding the complicated\r\njoins in class it expects a queryset to be provided along with headers (which are basically the text values for the\r\nfirst row of the HTML table or CSV file). Further, it requires the redefinition of the ``process_data`` which\r\nproduce a Python list of lists. Each element of the list shall contain exactly the same number of items as the\r\nheaders. There are some filtering options built in (date_upper, date_lower, per_page, page). Refer to the code\r\ndocumentation further.\r\n\r\nThere are some obligatory attributes that should be set in the child class:\r\n * ``verbose_name`` (example: verbose_name = 'Article word count')\r\n * ``fields`` (example: fields = [u'Article ID', u'Title', u'Slug', u'URL']\r\n * ``queryset`` (example: queryset = Article._default_manager.all())\r\n\r\nIf you want to have the date filtering set, you should provide the following attribute as well:\r\n * ``date_field`` (example: date_field = 'date_published')\r\n\r\nInstallation\r\n===================================\r\n1. Latest stable version on PyPI:\r\n\r\n $ pip install sirep\r\n\r\n2. Add 'sirep' to your ``INSTALLED_APPS``:\r\n\r\n >>> INSTALLED_APPS = (\r\n >>> # ...\r\n >>> 'sirep',\r\n >>> # ...\r\n >>> )\r\n\r\n3. Run the following django management command:\r\n\r\n $ ./manage.py collectstatic\r\n\r\n4. Add the following lines to the global urls.py file:\r\n\r\n >>> import sirep\r\n >>> sirep.autodiscover() # autodiscover sirep in applications\r\n >>> urlpatterns = patterns('',\r\n >>> # ... some patterns here\r\n >>> # Sirep URLs\r\n >>> (r'^sirep/', include('sirep.urls')),\r\n >>> # ... some other patterns here\r\n >>> )\r\n\r\n5. Create a report in the app directory for which you make the report and name the file \"report.py\" (follow the\r\nsirep.reports example). In order to see the demo, set the ``SIREP_SHOW_ADMIN_TEST_MODEL_DEMO`` to True in your\r\nlocal_settings and visit the \"http://localhost:8000/sirep/\" URL.\r\n\r\nExample app\r\n===================================\r\nIf you want to have a working example of the app, check the example directory of the source and follow the\r\ninstallation instructions described in `example/readme.rst`.\r\n\r\n https://bitbucket.org/barseghyanartur/sirep/src\r\n\r\nAn automated installer resides in `sirep_install_example.sh`. Download it somewhere, activate your virtual\r\nenvironement and run the installer. You will soon be able to see the example report\r\nhttp://127.0.0.1:8000/sirep/foo-report/.\r\n\r\nUsage examples\r\n===================================\r\nSample model module (file `test_package/models.py`):\r\n\r\n >>> class TestModel(models.Model):\r\n >>> \"\"\"\r\n >>> Test model for making a report.\r\n >>> \"\"\"\r\n >>> title = models.CharField(_(\"Title\"), max_length=50, blank=False, null=False)\r\n >>> counter = models.PositiveIntegerField(_(\"Counter\"), blank=True, null=True)\r\n >>> user = models.ForeignKey(User, null=True, blank=True)\r\n >>> date_published = models.DateTimeField(null=True, blank=True)\r\n >>>\r\n >>> class Meta:\r\n >>> verbose_name = _(\"Sirep test model\")\r\n >>> verbose_name_plural = _(\"Sirep test models\")\r\n >>>\r\n >>> def __unicode__(self):\r\n >>> return self.title\r\n\r\nSample report (file `test_package/reports.py`) module:\r\n\r\n >>> import sirep\r\n >>> from test_package.models import TestModel\r\n >>>\r\n >>> # Define the report class\r\n >>> class TestReport(sirep.Report):\r\n >>> verbose_name = 'Test report'\r\n >>> fields = [u'ID', u'Title', u'Counter', u'Username', u'E-mail']\r\n >>> items = []\r\n >>> limit = 200\r\n >>> date_field = 'date_published'\r\n >>> queryset = TestModel._default_manager.filter().select_related('user')\r\n >>>\r\n >>> def process_data(self):\r\n >>> queryset = self.get_queryset()\r\n >>>\r\n >>> self.items = []\r\n >>> for a in queryset:\r\n >>> self.items.append([\r\n >>> a.pk,\r\n >>> a.title,\r\n >>> a.counter,\r\n >>> a.user.username if a.user else '',\r\n >>> a.user.email if a.user else ''\r\n >>> ])\r\n >>>\r\n >>> # Register the report\r\n >>> sirep.register('test-report', TestReport)\r\n\r\nThat's all. You may now navigate to your report `http://127.0.0.1:8000/sirep/test-report/`. Note that `test-report`\r\nis the slug using which we have registered the report (`sirep.register`).\r\n\r\nLicense\r\n===================================\r\nGPL 2.0/LGPL 2.1\r\n\r\nSupport\r\n===================================\r\nFor any issues contact me at the e-mail given in the `Author` section.\r\n\r\nAuthor\r\n===================================\r\nArtur Barseghyan ", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/barseghyanartur/sirep", "keywords": "reporting,django,admin,app,python", "license": "GPL 2.0/LGPL 2.1", "maintainer": "", "maintainer_email": "", "name": "sirep", "package_url": "https://pypi.org/project/sirep/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sirep/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/barseghyanartur/sirep" }, "release_url": "https://pypi.org/project/sirep/0.5/", "requires_dist": null, "requires_python": null, "summary": "Simple reporting for Django admin.", "version": "0.5" }, "last_serial": 3472185, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "9341a183884ab812846eb445436e6e23", "sha256": "0a72c45f240a30a0fae7ae41294c7bb23753f97bc86e9ac2130207b6a9b6f86e" }, "downloads": -1, "filename": "sirep-0.2.tar.gz", "has_sig": false, "md5_digest": "9341a183884ab812846eb445436e6e23", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8256, "upload_time": "2013-05-11T19:27:43", "url": "https://files.pythonhosted.org/packages/73/3e/03ac39175d37a78c5255382ece80df54a498a66ee354457772e2e9a5aaa1/sirep-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "1253757e26163f543bf607513a16b3b8", "sha256": "7997a2791e852e68f281d5edd523a3c9073c54d198db7e329d9a821d6456e664" }, "downloads": -1, "filename": "sirep-0.3.tar.gz", "has_sig": false, "md5_digest": "1253757e26163f543bf607513a16b3b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8674, "upload_time": "2013-06-21T20:30:58", "url": "https://files.pythonhosted.org/packages/0c/a6/dc9fcb2886221ba71f2d413e1ad669103da04ab0dfc845f4e7422eb6c43d/sirep-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "84a1ccd2256ee2a16fea1b6a71152896", "sha256": "7d24e35596a9c971804655bebd7053362e3eded339edc7794bb20474909e734b" }, "downloads": -1, "filename": "sirep-0.4.tar.gz", "has_sig": false, "md5_digest": "84a1ccd2256ee2a16fea1b6a71152896", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12697, "upload_time": "2013-06-21T21:10:31", "url": "https://files.pythonhosted.org/packages/60/50/8c61899c83b73f8dd2278ffc560fcf76f7e6777ac470915706e604199563/sirep-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "b2218b7ab9a42f7e26573025a7acf1b9", "sha256": "4685c2c151acf7a106d208bb314010f9394edf8667442615bf0b815c3faaf379" }, "downloads": -1, "filename": "sirep-0.5.tar.gz", "has_sig": false, "md5_digest": "b2218b7ab9a42f7e26573025a7acf1b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12881, "upload_time": "2013-06-22T11:31:40", "url": "https://files.pythonhosted.org/packages/43/d9/544ad47bc7221dec86598ddeda8df888386a91a7edb6e177dfbcf8f9855e/sirep-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b2218b7ab9a42f7e26573025a7acf1b9", "sha256": "4685c2c151acf7a106d208bb314010f9394edf8667442615bf0b815c3faaf379" }, "downloads": -1, "filename": "sirep-0.5.tar.gz", "has_sig": false, "md5_digest": "b2218b7ab9a42f7e26573025a7acf1b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12881, "upload_time": "2013-06-22T11:31:40", "url": "https://files.pythonhosted.org/packages/43/d9/544ad47bc7221dec86598ddeda8df888386a91a7edb6e177dfbcf8f9855e/sirep-0.5.tar.gz" } ] }