mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-12-14 15:52:25 +03:00
Advanced django admin integration
This commit is contained in:
14
README.rst
14
README.rst
@@ -244,6 +244,20 @@ Besides ``LocalizedField``, there's also:
|
||||
title = LocalizedField()
|
||||
description = LocalizedBleachField()
|
||||
|
||||
Django Admin Integration
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
To enable widgets in the admin, you need to inherit from
|
||||
``LocalizedFieldsAdminMixin``:
|
||||
|
||||
.. code-block:: python
|
||||
from django.contrib import admin
|
||||
from myapp.models import MyLocalizedModel
|
||||
|
||||
from localized_fields.admin import LocalizedFieldsAdminMixin
|
||||
class MyLocalizedModelAdmin(LocalizedFieldsAdminMixin, admin.ModelAdmin):
|
||||
"""Any admin options you need go here"""
|
||||
admin.site.register(MyLocalizedModel, MyLocalizedModelAdmin)
|
||||
|
||||
Frequently asked questions (FAQ)
|
||||
--------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user