Abstract language model and management command to populate language model
Project description
This is a simple Django apllication that provide an abstract class to create a language model and a management command to populate your model with language titles and their codes.
A ManyToMany relationship to this language model can be useful to define a language field on other models.
Source of the Language codes which are used in this application is: http://data.okfn.org/data/core/language-codes#resource-language-codes
Installation
Install the application package using pip:
pip install django-langlink
add ‘langlink’ to the INSTALLED_APPS list on your settings file
How to use
Import the Language abstract model from langlink and use it to create your language model:
from langlink.models import Language
class MyLanguageModel(Language):
pass
after you create and migrate your models, run this management command to populate the data:
python manage.py add_languages my_app_name mylanguagemodel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django_langlink-0.1.2.tar.gz.
File metadata
- Download URL: django_langlink-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13ad6587cd411f2e49176d6aed5397cc12734dad2dc6b304c044aba7e95a6400
|
|
| MD5 |
6970bb6b69ef62ad10cca6ca3b60633d
|
|
| BLAKE2b-256 |
3150721529e6d4017a977eca20f0f434a7356cfb2d5359315940be096c0b2c0b
|