mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-19 14:28:58 +03:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8cc50889ec | ||
|
8494615d05 | ||
|
f0541c047b | ||
|
84658f6010 | ||
|
0e29871458 | ||
|
ffe235d3ac | ||
|
d7db2c58c0 | ||
|
6a7545a910 | ||
|
11bf4ee88a | ||
|
d3223eca53 | ||
|
f0ac0f7f25 | ||
|
93ffce557c | ||
|
7c432baec7 | ||
|
476a20ba88 | ||
|
ad99b77bcd | ||
|
151250505d | ||
|
d8b872758c | ||
|
a0ca977cab |
@@ -33,7 +33,7 @@ Installation
|
||||
.. code-block:: bash
|
||||
|
||||
INSTALLED_APPS = [
|
||||
....
|
||||
...
|
||||
|
||||
'django.contrib.postgres',
|
||||
'localized_fields.apps.LocalizedFieldsConfig'
|
||||
@@ -279,7 +279,7 @@ Besides ``LocalizedField``, there's also:
|
||||
|
||||
Allows storing integers in multiple languages. This works exactly like ``LocalizedField`` except that
|
||||
all values must be integers. Do note that values are stored as strings in your database because
|
||||
the backing field type is ``hstore``, which only allows storing integers. The ``LocalizedIntegerField``
|
||||
the backing field type is ``hstore``, which only allows storing strings. The ``LocalizedIntegerField``
|
||||
takes care of ensuring that all values are integers and converts the stored strings back to integers
|
||||
when retrieving them from the database. Do not expect to be able to do queries such as:
|
||||
|
||||
@@ -369,6 +369,10 @@ To enable widgets in the admin, you need to inherit from ``LocalizedFieldsAdminM
|
||||
admin.site.register(MyLocalizedModel, MyLocalizedModelAdmin)
|
||||
|
||||
|
||||
.. image:: ./images/admin-widget.png
|
||||
:alt: The appearance of admin widget
|
||||
|
||||
|
||||
Frequently asked questions (FAQ)
|
||||
--------------------------------
|
||||
|
||||
|
BIN
images/admin-widget.png
Normal file
BIN
images/admin-widget.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
@@ -22,6 +22,7 @@ class LocalizedFieldsAdminMixin:
|
||||
}
|
||||
|
||||
js = (
|
||||
'admin/js/jquery.init.js',
|
||||
'localized_fields/localized-fields-admin.js',
|
||||
)
|
||||
|
||||
|
@@ -233,4 +233,4 @@ class LocalizedIntegerValue(LocalizedValue):
|
||||
"""Returns string representation of value"""
|
||||
|
||||
value = self.translate()
|
||||
return str(value) if value is not None else None
|
||||
return str(value) if value is not None else ''
|
||||
|
4
setup.py
4
setup.py
@@ -33,7 +33,7 @@ with open(os.path.join(os.path.dirname(__file__), 'README.rst'), encoding='utf-8
|
||||
|
||||
setup(
|
||||
name='django-localized-fields',
|
||||
version='5.0a7',
|
||||
version='5.0a11',
|
||||
packages=find_packages(exclude=['tests']),
|
||||
include_package_data=True,
|
||||
license='MIT License',
|
||||
@@ -44,7 +44,7 @@ setup(
|
||||
author_email='open-source@sectorlabs.ro',
|
||||
keywords=['django', 'localized', 'language', 'models', 'fields'],
|
||||
install_requires=[
|
||||
'django-postgres-extra>=1.21a15',
|
||||
'django-postgres-extra>=1.22',
|
||||
'Django>=1.11',
|
||||
'deprecation==2.0.3'
|
||||
],
|
||||
|
3
tox.ini
3
tox.ini
@@ -1,11 +1,12 @@
|
||||
[tox]
|
||||
envlist = py35-dj{111,20,21}, py36-dj{111,20,21}, py37-dj{111,20,21}
|
||||
envlist = py35-dj{111,20,21,22}, py36-dj{111,20,21,22}, py37-dj{111,20,21,22}
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
dj111: Django>=1.11,<1.12
|
||||
dj20: Django>=2.0,<2.1
|
||||
dj21: Django>=2.1,<2.2
|
||||
dj22: Django>=2.2,<2.3
|
||||
-rrequirements/test.txt
|
||||
setenv =
|
||||
DJANGO_SETTINGS_MODULE=settings
|
||||
|
Reference in New Issue
Block a user