109 Commits

Author SHA1 Message Date
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
Swen Kooij
fb233e8f25 Make sure values are strings before saving LocalizedIntegerValue 2018-06-15 16:19:32 +03:00
Swen Kooij
90597da8fd Add a LocalizedIntegerField 2018-06-15 12:58:01 +03:00
Swen Kooij
752e17064d Deprecate LocalizedFileValue.localized() 2018-06-14 08:01:10 +03:00
Swen Kooij
def7dae640 Add LocalizedValue.translate()
LocalizedValue.translate() behaves the exact same as the str(..) cast
works, with the exception that it returns None if there is no value
instead of an empty string. This makes it easier to implement custom
value classes on top of the LocalizedValue class.

Behavior for str(..) stays the same as it was.
2018-06-14 07:57:02 +03:00
Swen Kooij
a76101c9ad Fix LocalizedFieldsAdminMixin not having a base class
This was a breaking change and broke a lot of projects.
2018-04-02 15:59:16 +03:00
Swen Kooij
d25b1b92fe Merge branch 'master' of https://github.com/SectorLabs/django-localized-fields 2018-03-31 16:53:48 +03:00
Swen Kooij
ccc46e1899 Allow raw dicts to be used in update statements 2018-03-31 16:53:10 +03:00
seroy
f161b5d047 fix admin widget tabs width in inline formset 2018-03-01 13:22:54 +03:00
seroy
d7889b0601 use label tag + for attribute instead of a + href for properly work with inline formsets 2018-02-20 00:58:08 +03:00
Dmitry Groshev
2a29efdf14
fix LocalizedValue.deconstruct (wrong module name) 2018-01-31 23:59:48 +00:00
Dmitry Groshev
d8eb3394d0 LocalizedFieldsAdminMixin can be used with inlines
LocalizedFieldsAdminMixin was inheriting from ModelAdmin. This means in a code like this

```python
class FooInline(LocalizedFieldsAdminMixin, admin.TabularMixin):
    pass
```

`__init__` was being resolved to `ModelAdmin.__init__` which is clearly wrong.
2018-01-29 13:39:47 +02:00
seroy
3d4f9c413e Fix non-valid HTML tags attributes 2017-07-18 13:52:17 +03:00
Swen Kooij
1accee0b59 Merge branch 'master' into widget_refactor 2017-07-18 09:33:59 +03:00
Swen Kooij
05bcd84a88 Merge pull request #29 from MELScience/required
Improved functionality of required parameter
2017-07-18 09:33:24 +03:00
seroy
69cf0df166 Use template-based widget rendering in AdminLocalizedFieldWidget 2017-07-18 00:29:44 +03:00
seroy
d8c5544e91 Use template-based widget rendering in AdminLocalizedFieldWidget 2017-07-17 22:53:47 +03:00
seroy
c4bf151938 Refactor required_langs into required 2017-07-17 20:53:50 +03:00
Swen Kooij
08690ab361 Fix outstanding PEP8 and Flake8 issues 2017-07-15 14:06:50 +03:00
Swen Kooij
5ac05efbd0 Slight clean up, use dict instead of {} 2017-07-15 14:04:09 +03:00
Swen Kooij
aff41f671a Implement code review suggestions for #29 2017-07-15 13:59:39 +03:00
Swen Kooij
968840188d Formatting cleanup in widgets.py 2017-07-15 13:48:54 +03:00
Unai Zalakain
e8e044f6e2 Add labels to localized subwidgets 2017-07-15 13:45:10 +03:00
seroy
aaf49614f2 improve functionality of required parameter 2017-07-14 15:07:48 +03:00
seroy
cc4bfb48b9 Fix incorrect indentation 2017-07-11 10:27:07 +03:00
seroy
0b4bb7295e Added value_to_string method 2017-06-26 18:27:03 +03:00
Swen Kooij
16e23963cc Add support for LOCALIZED_FIELDS_FALLBACKS 2017-06-26 13:27:52 +03:00
Swen Kooij
b10472d3e9 Officially deprecate LocalizedAutoSlugField 2017-06-26 13:10:21 +03:00
Swen Kooij
d7382fbf30 Add support for using a callable to populate slug with 2017-06-26 13:03:41 +03:00
Swen Kooij
51fc6959d2 Support for slugging from multiple fields 2017-06-26 12:34:50 +03:00
Swen Kooij
3b28a5e707 Fix PEP8 violations 2017-06-26 11:33:25 +03:00
seroy
e5d7cd25e2 Shorten names for everything 2017-06-19 21:58:48 +03:00
seroy
aacc712195 Merge branch 'master' of https://github.com/SectorLabs/django-localized-fields into extra-fields 2017-06-19 21:40:11 +03:00
seroy
d1790f1fc1 added missing 'r' in type LocalizedStringValue 2017-06-19 17:17:24 +03:00
Swen Kooij
b97a7f3c23 Fix crash when using LocalizedUniqueSlugField in a bulk_create 2017-05-31 11:31:04 +03:00
Swen Kooij
a8dc4fe837 Fix bug/typo in LocalizedField.from_db_value 2017-05-30 13:48:43 +03:00
Swen Kooij
06f7ee15f0 Add LocalizedRef expression for extracting the value in the current language 2017-05-30 13:38:27 +03:00
Swen Kooij
e5214b07ae Fix aggregation not expanding into a actual list 2017-05-30 13:07:07 +03:00
Swen Kooij
4305696f1b Fix pep8 issue, use two spaces before inline comment 2017-05-26 17:05:52 +03:00
Swen Kooij
92a53bc3d7 Fix various pep8/flake8/pylint errors 2017-05-25 19:40:03 +03:00
Swen Kooij
5a4f449363 Fix support for ArrayAgg 2017-05-25 19:23:52 +03:00
Swen Kooij
84c267330f Update docs on new import style 2017-05-25 19:11:39 +03:00
Swen Kooij
a1a02552b7 Shorten names for everything 2017-05-25 19:06:44 +03:00
Swen Kooij
bb84d7577c BREAKING CHANGE: Empty out __init__
It is bad practice to do this in Django. If somebody imports something
from the package before Django is loaded, you get a 'Apps aren't loaded yet.'
exception.
2017-05-25 18:51:11 +03:00
Swen Kooij
5e0343801f Restore LocalizedModel to its former glory as an convient way to get all the mixins 2017-05-25 18:50:20 +03:00
Swen Kooij
2df2ec8b36 Move LocalizedValueDescriptor into its own file 2017-05-25 18:45:21 +03:00
Swen Kooij
3fcaece894 Add missing docs to LocalizedField.contribute_to_class 2017-05-25 18:14:41 +03:00
Swen Kooij
093a9d58f2 Fix to_python not working with non-json values 2017-05-25 18:11:58 +03:00
Swen Kooij
cff22855c2 Revert "LocalizedUniqueSlugField refactored"
This reverts commit 03df76d6d795f4453629bf526cc04a86c6393adc.
2017-05-25 17:23:39 +03:00