mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-19 22:38:57 +03:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
946e9a67c4 | ||
|
36f6e946b0 | ||
|
909ebfee69 | ||
|
95284e6fd0 | ||
|
e84a5e4ff1 | ||
|
472c7bbc41 | ||
|
8cc50889ec | ||
|
8494615d05 | ||
|
f0541c047b | ||
|
84658f6010 | ||
|
0e29871458 | ||
|
ffe235d3ac | ||
|
d7db2c58c0 | ||
|
6a7545a910 | ||
|
11bf4ee88a | ||
|
d3223eca53 | ||
|
f0ac0f7f25 | ||
|
93ffce557c | ||
|
7c432baec7 |
18
.travis.yml
18
.travis.yml
@@ -1,18 +0,0 @@
|
|||||||
env:
|
|
||||||
- DJANGO_SETTINGS_MODULE=settings
|
|
||||||
sudo: true
|
|
||||||
before_install:
|
|
||||||
- sudo apt-get update -qq
|
|
||||||
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
|
|
||||||
- sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev libwebp-dev
|
|
||||||
- sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip
|
|
||||||
- sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev
|
|
||||||
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
|
|
||||||
language: python
|
|
||||||
python:
|
|
||||||
- "3.5"
|
|
||||||
services:
|
|
||||||
- postgresql
|
|
||||||
install: "pip install -r requirements/test.txt"
|
|
||||||
script:
|
|
||||||
- coverage run manage.py test
|
|
13
README.rst
13
README.rst
@@ -33,7 +33,7 @@ Installation
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
....
|
...
|
||||||
|
|
||||||
'django.contrib.postgres',
|
'django.contrib.postgres',
|
||||||
'localized_fields.apps.LocalizedFieldsConfig'
|
'localized_fields.apps.LocalizedFieldsConfig'
|
||||||
@@ -61,6 +61,13 @@ Installation
|
|||||||
('ro', 'Romanian')
|
('ro', 'Romanian')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
4. Apply migrations to enable the HStore extension:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
python manage.py migrate
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
@@ -369,6 +376,10 @@ To enable widgets in the admin, you need to inherit from ``LocalizedFieldsAdminM
|
|||||||
admin.site.register(MyLocalizedModel, MyLocalizedModelAdmin)
|
admin.site.register(MyLocalizedModel, MyLocalizedModelAdmin)
|
||||||
|
|
||||||
|
|
||||||
|
.. image:: ./images/admin-widget.png
|
||||||
|
:alt: The appearance of admin widget
|
||||||
|
|
||||||
|
|
||||||
Frequently asked questions (FAQ)
|
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 = (
|
js = (
|
||||||
|
'admin/js/jquery.init.js',
|
||||||
'localized_fields/localized-fields-admin.js',
|
'localized_fields/localized-fields-admin.js',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -17,17 +17,17 @@ class LocalizedAutoSlugField(LocalizedField):
|
|||||||
"""Automatically provides slugs for a localized
|
"""Automatically provides slugs for a localized
|
||||||
field upon saving."""
|
field upon saving."""
|
||||||
|
|
||||||
|
warnings.warn(
|
||||||
|
'LocalizedAutoSlug is deprecated and will be removed in the next major version.',
|
||||||
|
DeprecationWarning
|
||||||
|
)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
"""Initializes a new instance of :see:LocalizedAutoSlugField."""
|
"""Initializes a new instance of :see:LocalizedAutoSlugField."""
|
||||||
|
|
||||||
self.populate_from = kwargs.pop('populate_from', None)
|
self.populate_from = kwargs.pop('populate_from', None)
|
||||||
self.include_time = kwargs.pop('include_time', False)
|
self.include_time = kwargs.pop('include_time', False)
|
||||||
|
|
||||||
warnings.warn(
|
|
||||||
'LocalizedAutoSlug is deprecated and will be removed in the next major version.',
|
|
||||||
DeprecationWarning
|
|
||||||
)
|
|
||||||
|
|
||||||
super(LocalizedAutoSlugField, self).__init__(
|
super(LocalizedAutoSlugField, self).__init__(
|
||||||
*args,
|
*args,
|
||||||
**kwargs
|
**kwargs
|
||||||
|
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(
|
setup(
|
||||||
name='django-localized-fields',
|
name='django-localized-fields',
|
||||||
version='5.0a8',
|
version='5.3',
|
||||||
packages=find_packages(exclude=['tests']),
|
packages=find_packages(exclude=['tests']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
license='MIT License',
|
license='MIT License',
|
||||||
@@ -44,7 +44,7 @@ setup(
|
|||||||
author_email='open-source@sectorlabs.ro',
|
author_email='open-source@sectorlabs.ro',
|
||||||
keywords=['django', 'localized', 'language', 'models', 'fields'],
|
keywords=['django', 'localized', 'language', 'models', 'fields'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'django-postgres-extra>=1.21a15',
|
'django-postgres-extra>=1.22',
|
||||||
'Django>=1.11',
|
'Django>=1.11',
|
||||||
'deprecation==2.0.3'
|
'deprecation==2.0.3'
|
||||||
],
|
],
|
||||||
|
3
tox.ini
3
tox.ini
@@ -1,11 +1,12 @@
|
|||||||
[tox]
|
[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]
|
[testenv]
|
||||||
deps =
|
deps =
|
||||||
dj111: Django>=1.11,<1.12
|
dj111: Django>=1.11,<1.12
|
||||||
dj20: Django>=2.0,<2.1
|
dj20: Django>=2.0,<2.1
|
||||||
dj21: Django>=2.1,<2.2
|
dj21: Django>=2.1,<2.2
|
||||||
|
dj22: Django>=2.2,<2.3
|
||||||
-rrequirements/test.txt
|
-rrequirements/test.txt
|
||||||
setenv =
|
setenv =
|
||||||
DJANGO_SETTINGS_MODULE=settings
|
DJANGO_SETTINGS_MODULE=settings
|
||||||
|
Reference in New Issue
Block a user