{ "info": { "author": "Rafael Capdevielle, Angel Velasquez", "author_email": "angvp@archlinux.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-klingon\n========================\n\n\n.. image:: https://coveralls.io/repos/angvp/django-klingon/badge.png?branch=master\n :target: https://coveralls.io/r/angvp/django-klingon?branch=master\n\n.. image:: https://travis-ci.org/angvp/django-klingon.svg?branch=master\n :target: http://travis-ci.org/angvp/django-klingon\n\n.. image:: https://readthedocs.org/projects/django-klingon/badge/?version=latest\n :target: https://readthedocs.org/projects/django-klingon/?badge=latest\n :alt: Documentation Status\n \n.. image:: https://codeclimate.com/github/angvp/django-klingon/badges/gpa.svg\n :target: https://codeclimate.com/github/angvp/django-klingon\n :alt: Code Climate\n\n\nWelcome to the documentation for django-klingon!\n\ndjango-klingon is an attempt to make django model translations suck\nbut with no integrations pain in your app!\n\nSetup & Integration\n------------------------------------\n\nIn your settings files:\nadd django-klingon to INSTALLED_APPS::\n\n INSTALLED_APPS = (\n ...\n 'klingon',\n ...\n )\n\nspecify a default language if you want to use your fields to store the\ndefault language::\n\n KLINGON_DEFAULT_LANGUAGE = 'en'\n\nExtend you models to add API support:\nfirst add Translatable to your model Class definition. This will add the\nAPI functions::\n\n from klingon.models import Translatable\n ...\n class Book(models.Model, Translatable):\n ...\n\nin the same model add an attribute to indicate which fields will be\ntranslatables::\n\n ...\n translatable_fields = ('title', 'description')\n ...\n\nyour model should look like this::\n\n class Book(models.Model, Translatable):\n title = models.CharField(max_length=100)\n description = models.TextField()\n publication_date = models.DateField()\n\n translatable_fields = ('title', 'description')\n\n\nAdd admin capabilities:\n______________________\n\nyou can include an inline to your model admin and a custom action\nto create the translations. To do this in your ModelAdmin class do\nthis::\n\n from klingon.admin import TranslationInline, create_translations\n ...\n class BookAdmin(admin.ModelAdmin):\n ...\n inlines = [TranslationInline]\n actions = [create_translations]\n\n* see full example in example_project folder of source code of klingon\n\n\nUsing Specific Widgets in the TranslationInline form of the admin:\n________________________________________________\n\nYou can specify the widget to be use on an inline form by passing a dictionary to TranslationInlineForm.\nSo, you might want to extend the TranslationInline with a new form that will a \"widgets\" dictionary, \nwhere you can specify the widget that each filds has to use, for example::\n\n class RichTranslationInlineForm(TranslationInlineForm):\n widgets = {\n 'CharField': forms.TextInput(attrs={'class': 'klingon-char-field'}),\n 'TextField': forms.Textarea(attrs={'class': 'klingon-text-field'}),\n }\n\n class RichTranslationInline(TranslationInline):\n form = RichTranslationInlineForm\n\nand then you just simply use the RichTranslationInline class on your AdminModels, for example::\n\n class BookAdmin(admin.ModelAdmin):\n inlines = [RichTranslationInline]\n\n* see full example in example_project folder of source code of klingon\n\nUsing the API\n------------------------------------\n\nTo create the translation you can do the follwing:\n\nSuppose that you have and object called book::\n\n > book = Book.objects.create(\n title=\"The Raven\",\n description=\"The Raven is a narrative poem\",\n publication_date=datetime.date(1845, 1, 1)\n )\n\nyou can create translation for that instances like this::\n\n > book.set_translation('es', 'title', 'El Cuervo')\n > book.set_translation('es', 'description', 'El Cuervo es un poema narrativo')\n\na translation could be access individually::\n\n > self.book.get_translation('es', 'title')\n 'El Cuervo'\n > book.get_translation('es', 'description')\n 'El Cuervo es un poema narrativo'\n\nor you can get all translations together::\n\n > self.book.translations('es')\n {\n 'title': self.es_title,\n 'description': self.es_description,\n }\n\nInstallation:\n------------------------------------\n\n pip install django-klingon\n\n\nRunning the Tests\n------------------------------------\n\nYou can run the tests with via::\n\n python setup.py test\n\nor::\n\n python runtests.py\n\n\n\n\nHistory\n-------\n\n0.0.7 (2017-1-7)\n++++++++++++++++++\n\n* Removed support for Django 1.5 and 1.6 now klingon works from Django 1.7\n version in advance\n\n0.0.4 (2015-1-2)\n++++++++++++++++++\n\n* Add translatable_slug and a painless integration with klingon +\n django-autoslug.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/angvp/django-klingon", "keywords": "", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "django-klingon", "package_url": "https://pypi.org/project/django-klingon/", "platform": "", "project_url": "https://pypi.org/project/django-klingon/", "project_urls": { "Homepage": "http://github.com/angvp/django-klingon" }, "release_url": "https://pypi.org/project/django-klingon/0.0.8/", "requires_dist": null, "requires_python": "", "summary": "django-klingon is an attempt to make django model translation suck but with no integrations pain in your app!", "version": "0.0.8" }, "last_serial": 4505263, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c436b25bd007e186eaecba3fb7b1f57e", "sha256": "cb2b8ab1e75b94051a55c56ca0907bd66fa8257a3df03dd61d164437647a54fe" }, "downloads": -1, "filename": "django-klingon-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c436b25bd007e186eaecba3fb7b1f57e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9742, "upload_time": "2014-05-30T18:14:45", "url": "https://files.pythonhosted.org/packages/82/d9/b581f372d3328e7542b0e242de31adb5178ae0058be557371acaa7f56e33/django-klingon-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "70728ba7384225044ea252d0ccd8f572", "sha256": "a51e9c52a7b401604647421816e426b876cd27c2b47aaecca1cedb90cd796160" }, "downloads": -1, "filename": "django-klingon-0.0.2.tar.gz", "has_sig": false, "md5_digest": "70728ba7384225044ea252d0ccd8f572", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10679, "upload_time": "2014-06-07T20:35:38", "url": "https://files.pythonhosted.org/packages/e4/67/7fa9eed25590b775673042e7a9f9117110905445d9f281401afcdb2a8be0/django-klingon-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "cb35d20740f4838c724f3ad93ed97880", "sha256": "577812434123b0c959762a4f51cf4239d768cfdc8e18c0763d953153b5b4c0e1" }, "downloads": -1, "filename": "django-klingon-0.0.3.tar.gz", "has_sig": false, "md5_digest": "cb35d20740f4838c724f3ad93ed97880", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10197, "upload_time": "2014-12-08T09:42:30", "url": "https://files.pythonhosted.org/packages/75/59/75ef2c6c85ea05d3f0544d7568022b8fa26b7144335c7c9f845d799f2e70/django-klingon-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "00284e3c63917fbfecf3ed4229fd4a31", "sha256": "4a572c702beebb2396551463b8bb3702c5060a73d7cda1a7c35a01946e1714b0" }, "downloads": -1, "filename": "django-klingon-0.0.4.tar.gz", "has_sig": false, "md5_digest": "00284e3c63917fbfecf3ed4229fd4a31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11026, "upload_time": "2015-01-02T07:07:02", "url": "https://files.pythonhosted.org/packages/f1/7e/d2dd58c5cf4529fc34981092eac4cd228e6ba9a08c0899728b6660e0c714/django-klingon-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "c8cb09f60677a7ab349b7aedf1736d9f", "sha256": "462bd203339f92977aaa402c7e62c60b0dfe5583d42c3029ff967afa55413dc8" }, "downloads": -1, "filename": "django-klingon-0.0.5.tar.gz", "has_sig": false, "md5_digest": "c8cb09f60677a7ab349b7aedf1736d9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11110, "upload_time": "2015-07-06T20:24:31", "url": "https://files.pythonhosted.org/packages/eb/37/7ea03047ab6fd4d67eeaa425581f18b99692f346f55f79dc259e8b2b97e3/django-klingon-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "af7e8fb46032d9395b958c408491038f", "sha256": "fdecf53f915cf14a80f999a93e97a72ad9021effb6836fd0db6951bf526a5053" }, "downloads": -1, "filename": "django-klingon-0.0.6.tar.gz", "has_sig": false, "md5_digest": "af7e8fb46032d9395b958c408491038f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12064, "upload_time": "2015-11-01T20:36:31", "url": "https://files.pythonhosted.org/packages/e6/b5/72200d15fdbc9667f515412d42a74decf7e060ff528bedabc0f1749905e5/django-klingon-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "ae4f942fce34b113325bdc04f175cbbb", "sha256": "024dea434b7d0cbc7dc573c21db6a6857539ce7af305e9acb6c5c97762e11e20" }, "downloads": -1, "filename": "django-klingon-0.0.7.tar.gz", "has_sig": false, "md5_digest": "ae4f942fce34b113325bdc04f175cbbb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13951, "upload_time": "2017-01-07T07:41:08", "url": "https://files.pythonhosted.org/packages/28/86/3a9e53761d333cbe718602a470406ef662474eaae54e06f1a302fd0576c8/django-klingon-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "54f0dff7a7dfbbe6f2816f7b32b8d28c", "sha256": "b1e1e53c89606ecda19a9a8a7ac4b5a1568dde763082aeecacecdc7b8180888f" }, "downloads": -1, "filename": "django-klingon-0.0.8.tar.gz", "has_sig": false, "md5_digest": "54f0dff7a7dfbbe6f2816f7b32b8d28c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13885, "upload_time": "2018-11-20T00:08:54", "url": "https://files.pythonhosted.org/packages/91/49/df80867918e5b5719754b9d8d0541029c0beba2a1364a65b6149cd8f179b/django-klingon-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "54f0dff7a7dfbbe6f2816f7b32b8d28c", "sha256": "b1e1e53c89606ecda19a9a8a7ac4b5a1568dde763082aeecacecdc7b8180888f" }, "downloads": -1, "filename": "django-klingon-0.0.8.tar.gz", "has_sig": false, "md5_digest": "54f0dff7a7dfbbe6f2816f7b32b8d28c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13885, "upload_time": "2018-11-20T00:08:54", "url": "https://files.pythonhosted.org/packages/91/49/df80867918e5b5719754b9d8d0541029c0beba2a1364a65b6149cd8f179b/django-klingon-0.0.8.tar.gz" } ] }