{ "info": { "author": "Artur Barseghyan", "author_email": "artur.barseghyan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "===================================\ndjango-slim\n===================================\nSimple implementation of multi-lingual models for Django. Django-admin integration works out of the box.\nSupports `django-localeurl` integration.\n\nPrerequisites\n===================================\n- Django 1.5, 1.6, 1.7\n- Python 2.7.+, 3.3.+\n\nInstallation\n===================================\nNote, that Django 1.5 is required. Earlier versions are not supported.\n\n1. Installation\n\nLatest stable version on PyPI:\n\n $ pip install django-slim\n\nLatest stable version on bitbucket:\n\n $ pip install -e hg+https://bitbucket.org/barseghyanartur/django-slim@stable#egg=django-slim\n\nLatest stable version on github:\n\n $ pip install -e git+https://github.com/barseghyanartur/django-slim/@stable#egg=django-slim\n\n2. Add `slim` to ``INSTALLED_APPS`` of you settings module.\n\nUsage and examples\n===================================\nAn extensive example project is available at https://github.com/barseghyanartur/django-slim/tree/stable/example\ndirectory.\n\nScreenshots are present in documentation on PythonHosted (http://pythonhosted.org/django-slim/#screenshots).\n\nDemo\n-----------------------------------\nIn order to be able to quickly evaluate the django-slim, a demo app (with a quick installer) has been created\n(Debian only). Follow the instructions below for having the demo running within a minute.\n\nGrab the latest `django_slim_example_app_installer.sh`\n\n $ wget https://raw.github.com/barseghyanartur/django-slim/stable/example/django_slim_example_app_installer.sh\n\nCreate a new- or switch to existing- virtual environement, assign execute rights to the installer and run\nthe `django-slim-example-app-install.sh`.\n\n $ chmod +x django_slim_example_app_installer.sh\n\n $ ./django_slim_example_app_installer.sh\n\nGo to the front/back -end and test the app.\n\n- Front-end URL: http://127.0.0.1:8001/en/foo/\n- Admin URL: http://127.0.0.1:8001/admin/foo/fooitem/\n- Admin username: admin\n- Password: test\n\nLet's now step-by-step review our imaginary example app.\n\nsettings.py\n-----------------------------------\nAdd `slim` to installed apps.\n\n>>> INSTALLED_APPS = (\n>>> # ...\n>>> 'slim',\n>>> # ...\n>>> )\n\nAdd languages.\n\n>>> LANGUAGES = (\n>>> ('en', gettext(\"English\")), # Main language!\n>>> ('hy', gettext(\"Armenian\")),\n>>> ('nl', gettext(\"Dutch\")),\n>>> ('ru', gettext(\"Russian\")),\n>>> )\n\nexample/models.py\n-----------------------------------\n>>> from django.db import models\n>>>\n>>> from slim import LanguageField, Slim\n>>>\n>>> class FooItem(models.Model, Slim):\n>>> title = models.CharField(_(\"Title\"), max_length=100)\n>>> slug = models.SlugField(unique=True, verbose_name=_(\"Slug\"))\n>>> body = models.TextField(_(\"Body\"))\n>>> language = LanguageField()\n\nexample/admin.py\n-----------------------------------\n>>> from django.contrib import admin\n>>>\n>>> from slim.admin import SlimAdmin\n>>>\n>>> class FooItemAdmin(SlimAdmin):\n>>> list_display = ('title',)\n>>> fieldsets = (\n>>> (None, {\n>>> 'fields': ('title', 'slug', 'body')\n>>> }),\n>>> )\n>>>\n>>> admin.site.register(FooItem, FooItemAdmin)\n\nexample/views.py\n-----------------------------------\nWe assume that language code is kept in the request object (django-localeurl behaviour, which you're advised to use).\n\n>>> from slim import get_language_from_request\n>>>\n>>> from example.models import FooItem\n>>>\n>>> def browse(request, template_name='foo/browse.html'):\n>>> language = get_language_from_request(request)\n>>> queryset = FooItem._default_manager.filter(language=language)\n>>>\n>>> # The rest of the code\n\nMore on ORM filtering\n-----------------------------------\n>>> from example.models import FooItem\n>>> foo = FooItem._default_manager.all()[0]\n\n\nLet's assume, we have such record and it has been translated to Armenian (`hy`) and Dutch (`nl`). Original\ntranslation is named `Lorem ipsum`. Other translations have the language code appended to the title.\n\n>>> armenian_foo = foo.get_translation_for('hy')\n\n>>> dutch_foo = foo.get_translation_for('nl')\n\n\nIf we have a translated object, we can always get the main translation.\n\n>>> armenian_foo.original_translation == foo\nTrue\n\nAll available translations for ``foo``:\n\n>>> foo.available_translations()\n[, ]\n\nAll available translations for Armenian ``foo``.\n\n>>> armenian_foo.available_translations()\n[, ]\n\nSee https://github.com/barseghyanartur/django-slim/tree/stable/example directory for a working example.\n\ndjango-localeurl integration\n-----------------------------------\nInstallation\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ndjango-localeurl integration is fully supported for Python 2.6.* and 2.7.* and installs automatically\nwhen installing django-slim. If you are using Python 3, install a forked version of django-localeurl\n(since official version does not yet have support for Python 3).\n\nForked version from bitbucket:\n\n $ pip install -e hg+https://bitbucket.org/barseghyanartur/django-localeurl@stable#egg=localeurl\n\nIntegration\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nUse `slim.models.decorators.auto_prepend_language` decorator in order to have it working.\n\nExample (have in mind our `FooItem` model.\n\n>>> from django.core.urlresolvers import reverse\n>>>\n>>> from slim.models.decorators import auto_prepend_language\n>>>\n>>> class FooItem(models.Model):\n>>> # Some other code; have in mind previous pieces.\n>>> @auto_prepend_language\n>>> def get_absolute_url(self):\n>>> kwargs = {'slug': self.slug}\n>>> return reverse('foo.detail', kwargs=kwargs)\n\nDo not forget to add the ``LocaleURLMiddleware`` to the ``MIDDLEWARE_CLASSES`` (as first).\n\n>>> MIDDLEWARE_CLASSES = (\n>>> 'localeurl.middleware.LocaleURLMiddleware',\n>>> # The rest...\n>>> )\n\nAlso, add `localeurl` to ``INSTALLED_APPS``.\n\n>>> INSTALLED_APPS = (\n>>> # Some apps...\n>>> 'localeurl',\n>>> # Some more apps...\n>>> )\n\nLicense\n===================================\nGPL 2.0/LGPL 2.1\n\nSupport\n===================================\nFor any issues contact me at the e-mail given in the `Author` section.\n\nAuthor\n===================================\nArtur Barseghyan \n\n\n.. image:: https://d2weczhvl823v0.cloudfront.net/barseghyanartur/django-slim/trend.png\n :alt: Bitdeli badge\n :target: https://bitdeli.com/free", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/barseghyanartur/django-slim", "keywords": "multi-lingual,django,python", "license": "GPL 2.0/LGPL 2.1", "maintainer": null, "maintainer_email": null, "name": "django-slim", "package_url": "https://pypi.org/project/django-slim/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-slim/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/barseghyanartur/django-slim" }, "release_url": "https://pypi.org/project/django-slim/0.7.5/", "requires_dist": null, "requires_python": null, "summary": "Simple implementation of multi-lingual models for Django.", "version": "0.7.5" }, "last_serial": 3472181, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "c7fdabca1ec79007c1c44409a1c538bc", "sha256": "41cba84afe0a2f6c9366a891270031b90399fdd4ef4d54ac6d02cfc9b1466173" }, "downloads": -1, "filename": "django-slim-0.1.tar.gz", "has_sig": false, "md5_digest": "c7fdabca1ec79007c1c44409a1c538bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9274, "upload_time": "2013-06-20T23:41:32", "url": "https://files.pythonhosted.org/packages/31/cf/000a4627aedee055f573d00708f283a2524d12a7a12168d351152274c4d2/django-slim-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "0f4dc5c198acb95891f17649516eb7f0", "sha256": "24a49a0437967471e5c4a7c52391c4bfba4bffcb5b9616220e0239a121391c51" }, "downloads": -1, "filename": "django-slim-0.2.tar.gz", "has_sig": false, "md5_digest": "0f4dc5c198acb95891f17649516eb7f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10110, "upload_time": "2013-06-22T20:56:13", "url": "https://files.pythonhosted.org/packages/cd/e3/018a9948a9b047c8af892b939296bcee28f8c4eca7989a0a68aae085ff42/django-slim-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "07debf63c885b64cbcff703c7f87879e", "sha256": "fac5288a3a43c04661f37a35c549d1ce341d207af9d59bfcc3da38b65c625d27" }, "downloads": -1, "filename": "django-slim-0.3.tar.gz", "has_sig": false, "md5_digest": "07debf63c885b64cbcff703c7f87879e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10299, "upload_time": "2013-06-23T12:47:30", "url": "https://files.pythonhosted.org/packages/ff/64/488ccc11c451fe1e08ff5956d7117e86f7439bb17a372d5b1cd049c8e68d/django-slim-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "7a07b9877c71ef1e68485e3a7246ed36", "sha256": "c54181b4cab7e255a0669b960d7df123aa3f802dfd2c02e758d01c685d7d282b" }, "downloads": -1, "filename": "django-slim-0.4.tar.gz", "has_sig": false, "md5_digest": "7a07b9877c71ef1e68485e3a7246ed36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10841, "upload_time": "2013-06-26T12:58:45", "url": "https://files.pythonhosted.org/packages/64/73/ce2db1a313d1ee68e893e856097972fa71ee0b74b5fc7ff9a97e51ef6e44/django-slim-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "f3c78c8adb2692572a919da81cfd16cb", "sha256": "088e77c4f37380d6efec3d8b9124542d75f6b847ed82f72380f9b904828407ae" }, "downloads": -1, "filename": "django-slim-0.5.tar.gz", "has_sig": false, "md5_digest": "f3c78c8adb2692572a919da81cfd16cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11860, "upload_time": "2013-09-01T16:22:31", "url": "https://files.pythonhosted.org/packages/3a/a7/b381e7f7695e6cd9fc90a9d6e869d0ff799a91c8a62ee7ff4f304f4e48a3/django-slim-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "d43fe43716cf9b2a599d2b303aff6fe5", "sha256": "e4811df710e53e4d63ad282b26dcaa4ffdaabcb33d1edd1a8f9dd62262c33e67" }, "downloads": -1, "filename": "django-slim-0.6.tar.gz", "has_sig": false, "md5_digest": "d43fe43716cf9b2a599d2b303aff6fe5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13034, "upload_time": "2013-09-09T20:49:56", "url": "https://files.pythonhosted.org/packages/a5/cd/4c67e401f65fe2622da74b66e27a5ec822e14795664226b4207360ad65c6/django-slim-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "3497af2d524218622ed2310881ef1319", "sha256": "93952b10bc966433a5ce84273683a76a6135b53f42a2ee21f41b4912c45f6e70" }, "downloads": -1, "filename": "django-slim-0.7.tar.gz", "has_sig": false, "md5_digest": "3497af2d524218622ed2310881ef1319", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13381, "upload_time": "2013-09-19T22:59:10", "url": "https://files.pythonhosted.org/packages/81/41/d288eb5d164dfd58a57d0ea6a524aff752586f0dce02602857d5b0629938/django-slim-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "1a009b6e10506a798747fc7b01689c3e", "sha256": "186bf8a11ee29fd5baea198788c5cfb1afcb9c2906494347f2cf7867b5c5407f" }, "downloads": -1, "filename": "django-slim-0.7.1.tar.gz", "has_sig": false, "md5_digest": "1a009b6e10506a798747fc7b01689c3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13397, "upload_time": "2013-09-20T08:48:50", "url": "https://files.pythonhosted.org/packages/6b/c1/785b20cfeb638d012ec317bbee5faf9aab6e464d5262ebbc8412c6448ec3/django-slim-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "4a01872ba1bbc2a0cb7ccfb7e90af5b7", "sha256": "b28a4e17870228d526642c8a2f57bd22b320b99f116a6c8e23d4762310627484" }, "downloads": -1, "filename": "django-slim-0.7.2.tar.gz", "has_sig": false, "md5_digest": "4a01872ba1bbc2a0cb7ccfb7e90af5b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14890, "upload_time": "2013-12-24T22:32:38", "url": "https://files.pythonhosted.org/packages/cc/6c/19528864fdcddbedf823bdfe308d47bc710562abeeab94b63c3b6fb8f543/django-slim-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "613caf73e1494de57abb5911ca459e3e", "sha256": "4a32992b8917e18d3799c837b6c2bfaf16bd8ed2b45a79ad966970b735b7d5c9" }, "downloads": -1, "filename": "django-slim-0.7.3.tar.gz", "has_sig": false, "md5_digest": "613caf73e1494de57abb5911ca459e3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14991, "upload_time": "2014-05-21T22:56:51", "url": "https://files.pythonhosted.org/packages/82/07/9f65aeccdbf544484756c23832d45dde7cb1a260abbfb873f1109fb425f5/django-slim-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "7eb180e77ac677d76186bfa3ff4e296a", "sha256": "a521f9d5da0333bd1878813ad5da98dee66cca52af30d8572e9f72d0b8879e61" }, "downloads": -1, "filename": "django-slim-0.7.4.tar.gz", "has_sig": false, "md5_digest": "7eb180e77ac677d76186bfa3ff4e296a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14493, "upload_time": "2014-10-12T21:08:52", "url": "https://files.pythonhosted.org/packages/83/1a/d303746b95d2b5aa5cde8c16a08355954c44efed3db526fdccb8a572cfd4/django-slim-0.7.4.tar.gz" } ], "0.7.5": [ { "comment_text": "", "digests": { "md5": "de0700a6ea742354b5d7d8e2294d6520", "sha256": "7e9566f36334dd54416b8f86d79930c91a3c1cfe5afb40a60c40b1b698b3a59b" }, "downloads": -1, "filename": "django-slim-0.7.5.tar.gz", "has_sig": false, "md5_digest": "de0700a6ea742354b5d7d8e2294d6520", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14491, "upload_time": "2014-12-21T02:40:57", "url": "https://files.pythonhosted.org/packages/7e/cc/61b184efd8b1d79b4bf2e908e02f05a048e2a1864be74abeab6244ec1bb5/django-slim-0.7.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de0700a6ea742354b5d7d8e2294d6520", "sha256": "7e9566f36334dd54416b8f86d79930c91a3c1cfe5afb40a60c40b1b698b3a59b" }, "downloads": -1, "filename": "django-slim-0.7.5.tar.gz", "has_sig": false, "md5_digest": "de0700a6ea742354b5d7d8e2294d6520", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14491, "upload_time": "2014-12-21T02:40:57", "url": "https://files.pythonhosted.org/packages/7e/cc/61b184efd8b1d79b4bf2e908e02f05a048e2a1864be74abeab6244ec1bb5/django-slim-0.7.5.tar.gz" } ] }