A reusable Django app that allows you to add translatable tags to any other model.
Project description
A reusable Django app that allows you to add translatable tags to any other model.
Installation
To get the latest stable release from PyPi
pip install django-multilingual-tags
To get the latest commit from GitHub
pip install -e git+git://github.com/bitmazk/django-multilingual-tags.git#egg=multilingual_tags
Add multilingual_tags to your INSTALLED_APPS
INSTALLED_APPS = (
...,
'multilingual_tags',
)
Don’t forget to migrate your database
./manage.py migrate multilingual_tags
Usage
To add tags to a model, you have to add the MultilingualTagsAdminMixin to that model’s admin. In your own apps, you can just do the following:
from django.contrib import admin
from multilingual_tags.admin import MultilingualTagsAdminMixin
from my_app import models
class MyModelAdmin(MultilingualTagsAdminMixin, admin.ModelAdmin):
pass
admin.site.register(models.MyModel, MyModelAdmin)
This will render the inline admin form for adding tagged items.
If you want to add tags to a third party app, you might need to import its admin instead of Django’s ModelAdmin and then unregister and re-register the model.
from django.contrib import admin
from multilingual_tags.admin import MultilingualTagsAdminMixin
from other_app.admin import SomeModelAdmin
from other_app.models import SomeModel
class SomeModelCustomAdmin(MultilingualTagsAdminMixin, SomeModelAdmin):
pass
admin.site.unregister(SomeModel)
admin.site.register(SomeModel, SomeModelCustomAdmin)
Contribute
If you want to contribute to this project, please perform the following steps
# Fork this repository
# Clone your fork
mkvirtualenv -p python2.7 django-multilingual-tags
make develop
git co -b feature_branch master
# Implement your feature and tests
git add . && git commit
git push -u origin feature_branch
# Send us a pull request for your feature branch
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
Hashes for django-multilingual-tags-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cdccc51b2a3e7ef749a5344a89b1439359990faeb529e0b41d5834af081bc32 |
|
MD5 | c21174fac32a5ecdcd285f61fa050b20 |
|
BLAKE2b-256 | b9b4bb8e20fd3b342ae60efab1dcbd88a113572ff8707f400528abc76e5fea8c |