{"id":30065216,"url":"https://github.com/xi/django-parlor","last_synced_at":"2025-11-03T15:07:14.949Z","repository":{"id":308539261,"uuid":"1033229180","full_name":"xi/django-parlor","owner":"xi","description":"Django model translations with even less nasty hacks.","archived":false,"fork":false,"pushed_at":"2025-08-06T14:08:03.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-06T14:25:24.125Z","etag":null,"topics":["django","translation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-06T13:46:41.000Z","updated_at":"2025-08-06T14:08:27.000Z","dependencies_parsed_at":"2025-08-06T14:26:57.046Z","dependency_job_id":"9425f9cf-c223-46b5-b77c-313e65f2297d","html_url":"https://github.com/xi/django-parlor","commit_stats":null,"previous_names":["xi/django-parlor"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xi/django-parlor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fdjango-parlor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fdjango-parlor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fdjango-parlor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fdjango-parlor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xi","download_url":"https://codeload.github.com/xi/django-parlor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fdjango-parlor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269373068,"owners_count":24406313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","translation"],"created_at":"2025-08-08T05:49:59.881Z","updated_at":"2025-11-03T15:07:14.901Z","avatar_url":"https://github.com/xi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-parlor\n\nDjango model translations with even less nasty hacks.\n\n## Installation\n\n```\npip install django-parlor\n```\n\n## Usage\n\n```python\nfrom django.contrib import admin\nfrom django.db import models\n\nfrom parlor.admin import TranslatableAdmin\nfrom parlor.models import TranslatableModel\n\n\nclass MyModel(TranslatableModel):\n    ...\n\n\nclass MyModelTranslation(models.Model):\n    parent = MyModel.get_parent_field()\n    language_code = MyModel.get_language_field()\n\n    label = models.CharField(max_length=32)\n    ...\n\n    class Meta:\n        unique_together = [('parent', 'language_code')]\n\n\nadmin.site.register(MyModel, TranslatableAdmin)\n\nanimal = MyModel.objects.create()\nanimal.translations.create(language_code='en', label='Frog')\nanimal.translations.create(language_code='de', label='Frosch')\nprint(animal.label)\n```\n\n## Status\n\nRight now this is more of a proof-of-concept. If people are interested in this\nlibrary it could certainly be expanded.\n\n## Relation to django-parler\n\n### Standing on the Shoulders of Giants\n\nThere are two popular libraries for model translation in Django:\n[django-modeltranslation](https://github.com/deschler/django-modeltranslation)\nand [django-parler](https://github.com/django-parler/django-parler). The former\nadds additional columns to the same table while the latter adds a new table for\neach translatable model. Both of these libraries use a lot of magic which makes\nthem easy to use, but also leads to some hard-to-debug edge cases.\n\nThere is also\n[django-translated-fields](https://github.com/matthiask/django-translated-fields),\nwhich uses the same basic approach as django-modeltranslation, but with much\nless magic (and much less lines of code).\n\nHere I try to do something similar for django-parler, which has been\nunmaintained for some time now.\n\n### Migration\n\nIf you want to migrate from django-parler to django-parlor, you need to replace\nall instances of `parler.TranslatedFields` by explicit translation models as\ndescribed above. Note that the `parent` field is called `master` in\ndjango-parler.\n\nTo keep using the same data, you will also need to set `Meta.db_table` to the\nname generated by django-parler (typically `myapp_mymodel_translation`).\n\nFinally you should run `manage.py makemigrations`. The generated migrations\nwill only contain minor changes though.\n\n### Conceptual differences\n\n-   With django-parlor, the translation model must be created explicitly.\n-   In the admin UI, django-parlor uses a stock inline instead of a custom\n    tabbed interface.\n-   django-parlor only provides basic attribute access while django-parler\n    provides a lot more features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxi%2Fdjango-parlor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxi%2Fdjango-parlor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxi%2Fdjango-parlor/lists"}