Swen Kooij
e6527fff4c
Don't double key transform in lookups
...
In Django 4.2, `process_lhs()` is called for IsNull lookups,
which is how this bug came to appear. It was already there
and could be reproduced on Django 3.2.
The issue is when `LocalizedRef` is combined with a localized
lookup. The lookup is unaware of the existing localized ref
and adds another transform on top. This results in the
expression becoming:
```
field->'en'->'en'
```
2024-07-02 07:10:41 +03:00
Roman Selivanov
c35844b471
Fix type hint for required
kwarg
2024-07-02 07:10:29 +03:00
Tudor Văran
5bb16af6a4
Support for Django 4 ( #101 )
...
* Support for Django 4
* Change pytest-django version
* Change psycopg2 version
* Change pytest version
* Change tox version
* Change pytest-cov version
* Update circle ci jobs
* Fix ci jobs
* Update ci to postgres 12
* Allow Django 5.0
* Bump Django min version to 3.2
* Fix CI to account for >= 3.2 requirement
* Fix quote
* Remove python 3.12 for now due to distutils removal
* Remove Django upper bound
* Add back python3.6,3.7 wfs
* Downgrade dj-database-url
* Fix isnull issue from Django 4
2024-06-04 12:49:13 +03:00
GRazvan12
463c415be2
Add deconstruct method for LocalizedBleachField for it to be recognized in django migrations
2024-01-23 16:45:57 +01:00
Gherman Razvan
911251ebaa
Prevent LocalizedBleachField from escaping values ( #97 )
2024-01-23 13:52:37 +01:00
Gherman Razvan
a66b3492cd
Add LocalizedBooleanField ( #93 )
2023-08-10 14:33:47 +02:00
Swen Kooij
cc911d4909
LocalizedAutoSlugField should only warn about deprecation if used
2021-11-08 15:08:08 +02:00
Swen Kooij
7902d8225a
Do not set default_app_config for Django 3.2 and newer
...
See: See: https://docs.djangoproject.com/en/3.2/releases/3.2/#what-s-new-in-django-3-2
2021-11-08 14:36:45 +02:00
Swen Kooij
92cb5e8b1f
Add LocalizedValue.is_empty()
2021-03-22 07:47:00 +02:00
Swen Kooij
1b3e5989d3
LocalizedUniqueSlugField should properly deconstruct 'enabled' flag
2021-03-13 13:45:22 +02:00
Swen Kooij
bd8924224e
Add flag to disable LocalizedUniqueSlugField
2021-03-13 13:24:36 +02:00
Swen Kooij
afb94ecf66
Add a flag to make LocalizedUniqueSlugField immutable
2020-11-27 16:36:23 +02:00
Cristi Ingineru
8ed09f712d
Prevent accumulating redundant data
2020-11-25 12:00:11 +02:00
seroy
c9ae71aec7
introduce ActiveRef and TranslatedRef lookups
2020-10-07 11:56:33 +03:00
Swen Kooij
5a9ff191d4
Use force_str() over force_text()
...
force_text() is going to be removed in Django 4.0
It's just an alias for now.
2020-10-07 11:52:24 +03:00
tudorvaran
7f48903137
Change from docstring comment to normal
2020-04-29 12:16:25 +03:00
tudorvaran
3bf4435622
Disable show_hidden_initial for localized forms
2020-04-28 21:23:03 +03:00
tudorvaran
77e8807876
Revert "Fix callable default usage in admin forms"
...
This reverts commit f807212c
2020-04-28 21:16:15 +03:00
tudorvaran
f807212cf3
Fix callable default usage in admin forms
2020-04-28 18:31:15 +03:00
Alexandru Arnautu
8968b0c7a8
Format and lint code
2020-03-10 09:33:34 +02:00
Alexandru Arnautu
5e1d46669c
Create LocalizedNumericValue with __int__ and __float__ methods
2020-03-10 09:28:52 +02:00
Alexandru Arnautu
5ed1a1219d
Add LocalizedFloatField
2020-03-10 09:27:31 +02:00
Alexandru Arnautu
0d9ec6385c
Add LocalizedFloatValue
2020-03-10 09:26:00 +02:00
tudorvaran
905bfd4353
Format with black
2020-02-12 17:05:17 +02:00
tudorvaran
47367da401
Accept callables as values in fields
2020-02-12 16:37:44 +02:00
Swen Kooij
49d88af76a
Python 3.6, 3.9 and Django 3.0 compatibility
2020-01-06 16:51:30 +01:00
jar3b
769066a461
fix: remove django.utils.six import and usage due to Django 3.0 dropped support for it
2019-12-14 23:12:01 +03:00
Swen Kooij
92b1dce239
Set LOCALIZED_FIELDS_EXPERIMENTAL to True by default
2019-10-20 18:05:06 +03:00
Swen Kooij
7bf0311306
Add a language argument to LocalizedValue.translate(..)
2019-10-20 16:49:33 +03:00
Swen Kooij
e5dcc1b492
Fix #72 : LocalizedIntegerField should sort numerically, not lexicographically
2019-10-19 15:48:29 +03:00
Swen Kooij
19f0ddb336
Fix some flake8/pycodestyle issues
2019-10-19 13:04:53 +03:00
Swen Kooij
7cdd1f4490
Re-format all files
2019-10-19 12:44:41 +03:00
Swen Kooij
3de1492a58
Use collections.abc.Iterable instead of collections.Iterable
...
The latter is going to be removed after Python 3.8
2019-08-14 08:57:05 +03:00
Swen Kooij
36f6e946b0
Attempt at reducing deprecation warning spam
2019-06-27 15:15:44 +03:00
Dmitry Groshev
6a7545a910
update to support Django 2.2
2019-05-30 13:11:33 +01:00
Adrian Muntean
d8b872758c
Return empty string in case of None
2019-02-20 12:26:04 +02:00
Adrian Muntean
a0ca977cab
Set None in case the LocalizedIntegerField is null
...
In case the LocalizedIntegerField is null in the DB then it must explicitly be set to None,
otherwise it will yield TypeError: __str__ returned non-string
2019-02-14 14:48:38 +02:00
Swen Kooij
25417b5815
Merge pull request #56 from sliverc/user_defined_pk_descriptor
...
Avoid DoesNotExist error when creating model with user defined pk
2019-01-11 14:47:33 +02:00
Swen Kooij
abd1587ca0
Merge pull request #54 from sliverc/query_by_active_lang
...
Add support for localized query lookups
2019-01-11 14:47:18 +02:00
Swen Kooij
60fc79e9ff
Merge pull request #57 from velrest/master
...
Fix typo in documentation for clean
2019-01-11 14:46:21 +02:00
Swen Kooij
ca470fc577
Merge pull request #49 from MELScience/admin-fix
...
Add tests for LocalizedFieldsAdminMixin
2019-01-11 14:46:10 +02:00
Swen Kooij
d66f5085a8
Merge branch 'master' into hstore_extension
2019-01-11 14:40:38 +02:00
Oliver Sauder
ff836836bf
Add support for localized query look ups
2018-12-03 09:45:08 +01:00
Cristi Ingineru
4922a1b93f
self.translate()
2018-09-24 12:57:46 +03:00
Jonas Cosandey
d308e773cf
fix typo
2018-09-12 14:27:44 +02:00
Oliver Sauder
b3b88d6d28
Avoid does not exist error when creating model with user defined pk
2018-09-10 12:05:46 +02:00
Oliver Sauder
6c902229ce
Enable HStore extension for localized fields to work
2018-08-27 15:07:41 +02:00
Cristi Ingineru
4f83cbf4ed
Add LocalizedIntegerFieldWidget
2018-08-16 14:27:38 +03:00
Cristi Ingineru
13e2666a51
Copy the widget for each language
2018-06-28 12:33:44 +03:00
Swen Kooij
1b1d24a460
Make defaults work for LocalizedIntegerField
2018-06-15 17:07:12 +03:00