Commit graph

347 commits

Author SHA1 Message Date
Moetaz
533c3cb594 fixed "Reset to default" button with constants whose name contains a space. closes #321 (#322) 2019-03-13 19:04:33 -05:00
horida
286edca505 show not existing fields in field_list (#309) 2018-10-11 12:18:39 -05:00
Camilo Nova
ce565ecd8a Bump version 2018-09-20 07:31:31 -05:00
Erivânio Vasconcelos
a188c65281 Remove duplicated } (#302) 2018-09-19 18:49:03 -05:00
Camilo Nova
678916bcc2 Bump version 2018-09-13 15:16:17 -05:00
Jürgen Ryannel
6cc9ebfb67 Added support for django 2.1
* in django>=2.1 cmd was removed as parameter to add_parser

* add tox support for django >= 2.1

* introduce helper function to remove cmd paramter form add_parsers when
django >= 2.1

* remove unecessary lines

* fix issues when cmd may be missing in kwargs
2018-08-29 10:18:22 -05:00
Imran Iqbal
c9916c7e26 Improve consistency of reset value handling for date
* Consistent implementation re: `datetime`
* Consistent reset using `DATE_INPUT_FORMAT`, i.e.
  - Works whether `USE_L10N` setting is active or not
2018-05-07 17:55:43 +01:00
ykh
887ee92e62 fix bug of can't change permission chang_config's name 2018-04-20 17:50:20 +08:00
ykh
b032f8f72b update Chinese translation 2018-04-19 11:53:33 +08:00
Dmitry Karamin
45da6edd28 fix(admin): date type 2018-04-16 21:41:18 +03:00
0bit
6abc66b2d7 add zh_Hans 2018-03-26 10:12:12 +08:00
Camilo Nova
40c009d2d3 Bump version 2018-03-23 08:35:02 -05:00
Camilo Nova
61356da3fb
Merge pull request #258 from ownaginatious/constance_dbs_setting
Workaround to make `django-constance` work in multi-DB project
2018-03-15 13:49:25 -05:00
Si Feng
1bec11477f Fix CONSTANCE_CONFIG_FIELDSETS mismatch issue 2018-03-13 16:56:00 -07:00
Paolo Melchiorre
e390248bf0 Updated italian translations 2018-03-13 15:27:39 +01:00
Anton Shurashov
40188c093a add config labels 2018-03-06 23:41:53 +03:00
Dillon Dixon
5763010f16 CONSTANCE_DBS setting for directing constance permissions/content_type settings to certian DBs only 2018-03-02 15:40:41 -08:00
Matthieu Cornut
2cec39d609 Fix issue https://github.com/jazzband/django-constance/issues/252 2018-02-27 16:48:41 +01:00
Matthieu Cornut
1dc4b06020 Fix bug in translation file 2018-02-27 16:48:41 +01:00
Vladislav Manchev
b37b73bf0e
Fix ConstanceForm validation
Account for cases where CONSTANCE_CONFIG_FIELDSETS is not set at all in ConstanceForm validation.
2018-02-25 14:27:54 +01:00
Camilo Nova
bc9b11b8fa Bump version 2018-02-07 09:05:51 -05:00
Camilo Nova
29f493f7c1 Merge branch 'file-upload' 2017-11-08 08:42:34 -05:00
Manatsawin Hanmongkolchai
bbc7db2edc Merge https://github.com/jazzband/django-constance 2017-11-07 21:45:04 +07:00
Manatsawin Hanmongkolchai
6015e9c360 results_list: Move inline JavaScript to constance.js
Merge branch 'default-datetime' of https://github.com/rvernica/django-constance
2017-11-07 21:43:47 +07:00
Camilo Nova
643e8401b6
Merge pull request #224 from founders4schools/translations/french
Add French translations
2017-11-06 11:47:57 -05:00
Camilo Nova
7da7598291
Merge pull request #222 from JoshLabs/vb_validation_fix
Fixed #201
2017-11-06 11:47:22 -05:00
Camilo Nova
2d86960ab9 Remove translation from the app name. Fixes #204 2017-11-06 11:43:08 -05:00
Camilo Nova
23e8557c83 Added file uploads. Fixes #141 and #241 2017-11-06 11:31:00 -05:00
Camilo Nova
03ba898db3 Merge pull request #220 from mpauly/master
Fix for #219
2017-09-06 14:10:15 -05:00
Manatsawin Hanmongkolchai
0e38ae7ce1 database: Allow running set while database is not created 2017-08-20 19:44:16 +07:00
Manatsawin Hanmongkolchai
c8568b3f6b Moved inline css/javascripts out to their own files 2017-08-09 19:44:48 +07:00
Manatsawin Hanmongkolchai
f8aad0c7f6 Also ignore ProgrammingError for Postgres 2017-08-08 18:39:01 +07:00
Manatsawin Hanmongkolchai
bbfa8fa7dc database: Ignore operation errors (#229) 2017-08-07 23:56:20 +07:00
Bruno Alla
717304f8c0 Add French translations 2017-07-03 12:49:07 +01:00
Varun Bargali
d80acd0dc6 updated message files 2017-06-13 19:41:38 +05:30
Varun Bargali
d3da1e14bd added validation error for forgetting variables in CONSTANCE_CONFIG_FIELDSETS 2017-06-13 19:37:39 +05:30
Martin Pauly
3f5fc73409 Use admin_site property of ModelAdmin, to make sure that the correct list of apps is used 2017-06-02 23:27:20 +02:00
Jon Dufresne
9725bb2a94 Use dict comprehension; available since Python 2.7 (#217) 2017-06-02 10:53:08 +02:00
Bruno Alla
1cce582edc Fix #187: Preserve sorting from fieldset config (#207) 2017-06-02 10:52:16 +02:00
Jon Dufresne
3a1f8a898b Remove unnecessary calls to dict.keys
iter(dict) is equivalent to iter(dict.keys()). Can simply act on the
dict instead. Provides a more concise, Pythonic syntax and avoids an
unnecessary function call.

Inspired by Lennart Regebro's presentation "Prehistoric Patterns in
Python" at PyCon 2017. Available at:

https://www.youtube.com/watch?v=V5-JH23Vk0I
2017-06-02 10:23:21 +02:00
Camilo Nova
4268ea808a Merge pull request #213 from felixxm/cleanup-unused
Removed unused variables and imports.
2017-05-25 14:38:42 -05:00
Mariusz Felisiak
3af72e167b
Removed unused variables and imports. 2017-05-25 14:02:52 +02:00
Mariusz Felisiak
fc5a32f2ac
Fixed #211 -- Added datetime.timedelta support. 2017-05-25 13:50:27 +02:00
Alan Kesselmann
47b8394a43 Added .mo file too 2017-04-10 14:03:19 +03:00
Alan Kesselmann
09f2dc7d69 Added Estonian translations 2017-04-10 13:38:27 +03:00
Rares Vernica
0f7a6e8f55 Account for server timezone for Date object 2017-02-20 10:57:12 -08:00
Camilo Nova
161c1d34be Bump version 2017-02-17 08:16:34 -05:00
Camilo Nova
6da21af5ae Merge pull request #195 from jazzband/updated_signal
Added the old value to the config_updated signal
2017-02-16 16:07:34 -05:00
Martin Pépin
be65f6536a Add a get_changelist_form hook in the ModelAdmin
This method is used in the `changelist_view` to get the changelist form.

You may want to override this method to get a different form depending
on the user that makes the request. For example:

  class MyConstanceAdmin(ConstanceAdmin):
      def get_changelist_form(self, request):
          if request.user.is_superuser:
              return SuperuserForm:
          else:
            return super(MyConstanceAdmin, self).get_changelist_form(request)
2017-02-14 02:15:39 +01:00
Laszlo Ratsko
3ba4780a13 Fix create_perm in apps.py to use database alias given by the post_migrate signal 2017-02-05 13:27:07 +01:00
Mariusz Felisiak
46b7a02365
Removed unnecessary bytes encode. 2017-01-31 18:08:04 +01:00
Camilo Nova
2fde4f4d83 Added the old value to the config_updated signal 2017-01-31 10:41:55 -05:00
Rares Vernica (cessna, fedora)
d308ccf601 Fix Reset to default for DateTime, #185 2017-01-19 10:55:48 -08:00
Rares Vernica
bddb6cd2ac Fix *Reset to default* to work with boolean/checkboxes (#191)
* Fix *Reset to default* to work with boolean/checkboxes

* Add field name to each config value
* Check field name and use *checked* for checkbox and *value* otherwise

Fix #189

* Add and use raw_default and is_checkbox
2017-01-13 08:14:18 +01:00
John Carter
81b723c91b Fix handling of MultiValueField's (eg SplitDateTimeField) on the command line. Fixes #186 (#190)
* Added failing test for setting a datetime with cli

Issue #186

* Adding myself to AUTHORS

* Handle MultiValueField in manage command, resolves #186

* newline at end
2017-01-11 09:52:19 +01:00
Camilo Nova
8db90e8087 Bump version 2016-12-23 17:39:01 -05:00
Rares Vernica (cessna, fedora)
588ac2da71 Moved "Remove to default" unded field 2016-12-01 09:40:11 -08:00
Rares Vernica (cessna, fedora)
32c760cc1d Add "Reset to default" feature 2016-11-30 12:39:55 -08:00
John Carter
e3ea904116 Backport command functonality from django-constance-cli (squashed) 2016-11-27 18:55:21 +13:00
John Carter
4599a22bfc Don't ignore additional fields when creating form
Fixes regression from 2f88a1bff2
2016-11-27 17:18:35 +13:00
Rares Vernica
6ce7f1a308 Preserve line breaks in default value 2016-11-21 11:39:08 -08:00
Rares Vernica
8da8b4278c Add each_context to context and use dict syntax (#176) 2016-11-18 13:04:54 +01:00
Rares Vernica
70f1043bad Facilitate renaming Constance in Admin (#173)
* Load app_config dynamically and use verbose_name

* Instead of assuming the app config is always going to be ConstanceConfig, load it dynamically in case the user overrides it
* Use verbose_name for page title instead of static strings for create_list
* Use verbose_name for create_list breadcrumbs

These changes allows the user to easily rename "Constance" to something else in their project.

* Fix use of verbose_name in title and breadcrumbs
2016-11-17 08:42:55 +01:00
Miguel García
dd173cd42c Add app_config property to Config model 2016-10-27 18:27:37 +02:00
Camilo Nova
2f88a1bff2 Ignore fields in CONSTANCE_ADDITIONAL_FIELDS when casting a type 2016-10-12 16:59:56 -05:00
Camilo Nova
4fc8fdd3d0 Fix parameter ordering 2016-10-12 16:40:49 -05:00
Camilo Nova
bced16bfc7 Fixes #163 2016-10-12 16:09:18 -05:00
Mariusz Felisiak
9709b211d5 Fixed #169. Added localize to check modified flag. 2016-10-10 23:00:35 +02:00
Maxim Luzin
1e40db7fda Fix config ordering. 2016-10-01 18:07:40 +07:00
Camilo Nova
2c123af788 Bump version 2016-09-17 17:27:58 -05:00
Camilo Nova
bfc09f9982 Revert "Only set the attribute if value has changed"
This reverts commit 56fb550044.
2016-09-17 17:23:07 -05:00
Camilo Nova
826c494fd1 Bump version 2016-09-17 15:31:02 -05:00
Camilo Nova
56fb550044 Only set the attribute if value has changed 2016-09-17 15:18:29 -05:00
Camilo Nova
080f72f58d Bump version 2016-09-15 14:02:35 -05:00
Camilo Nova
0f049e4677 Merge pull request #159 from jazzband/signals
Moved the signal to its own file to avoid import errors. Fixes #158
2016-09-15 13:59:18 -05:00
Camilo Nova
5eeb77f9b0 Improved naming for arguments 2016-09-15 09:25:54 -05:00
Camilo Nova
bebc279edc Send the config parameter as sender for the signal 2016-09-15 09:24:30 -05:00
Camilo Nova
1830556c97 ☀️ Improve html layout when using fieldsets 2016-09-14 16:35:30 -05:00
Camilo Nova
1d746c080f Rename signal to config_updated 2016-09-14 14:53:52 -05:00
Camilo Nova
395efc992f ☀️ Moved the signal to its own file to avoid import errors 2016-09-14 14:50:39 -05:00
Camilo Nova
9d4d0ab334 Bump version 2016-09-14 12:44:59 -05:00
Camilo Nova
94fabdf7c3 Added signal on change, refs #158 2016-09-14 12:22:32 -05:00
Camilo Nova
90bf97c0a9 Improved coding styles 2016-09-14 12:21:43 -05:00
Camilo Nova
03704ee4f7 Improve coding style and remove django 1.7 compatibility 2016-09-14 11:52:58 -05:00
Ankush Chadda
7e20386682 ordering contance fields using OrderedDict 2016-09-10 16:11:36 +05:30
Camilo Nova
0b9a00099a Bump version 2016-09-01 18:41:27 -05:00
Farooq Azam
80d5fb5954 Added support for fieldsets. 2016-08-22 02:45:57 +05:00
Farooq Azam
a39a46e699 Used self.model instead Config to fix inheritance issues.
I tried to inherit the Config model and changed the app_label but it wasn't working because Config was hard-referenced here.
2016-08-21 21:40:17 +05:00
Jan Nakladal
e95f372b2f autofill cache if key si missing. 2016-07-12 16:31:11 +12:00
Maxim Filipenko
1b6730d2c5 Invalidate cache 2016-06-03 17:40:32 +03:00
Camilo Nova
c9d23c6d39 Fixes #141 2016-05-24 18:54:33 -05:00
Camilo Nova
8f71bca192 Bump version 2016-05-14 09:06:02 -05:00
jonzlin95
e2a4c6668b Fix setting name 2016-04-08 15:03:47 -07:00
jonzlin95
0aa1a7dd6a Use SplitDateTimeField due to DateTimeField + SplitDateTimeWidget deprecation 2016-04-05 15:44:12 -07:00
Emilio Ramirez
3524d3f210 is a good idea keep te constance at the begining of the variable name for avoid conflicts 2016-03-29 15:13:22 -03:00
John Carter
8101d7cc84 Make CONSTANCE_ADDITIONAL_FIELDS more flexible
Allow the field config to be a tuple, and allow the config dict to be omitted
2016-03-13 00:05:16 +13:00
Francesc Arpi
1b9458c74b Added CONSTANCE_IGNORE_ADMIN_VERSION_CHECK settings option to ignore the version protection. When you use django-constance on a cloud platform, with several machines, giving you problems by keeping the machine does not have to be the same which has served constant form. 2016-03-01 17:37:35 +01:00
Martin Pauly
ebdc1a6b9f Moved ConstanceForm to a property to make it exchangable by inheritance 2016-02-22 14:50:41 +01:00
Camilo Nova
d84f0283c8 Bump version 2016-02-08 07:55:33 -05:00
Camilo Nova
8121802f52 Merge pull request #123 from federicobond/svg-icons
Replace removed gif icons with svg versions
2016-02-08 07:45:29 -05:00
Federico Bond
1558a7c67e Replace removed gif icons with svg versions 2016-02-07 16:58:53 -03:00
Jürno Ader
201ba03762 Safer custom fields 2015-11-13 12:02:41 +01:00
Petr Dlouhý
55ddbad52c Merge remote-tracking branch 'jezdez/master' into custom_fields 2015-11-13 11:44:56 +01:00
Jannis Leidel
6b04a3169e Bumped up version. 2015-10-01 18:20:14 +02:00
Jannis Leidel
c82d76fc28 Fix #115 - stop shadowing the context processor's config variable when rendering the admin change list. 2015-10-01 18:16:39 +02:00
Jannis Leidel
a005625f97 Bumped version. 2015-09-24 12:50:29 +02:00
Jannis Leidel
527bc0ca7e Updated Chinese translation. 2015-09-24 12:37:35 +02:00
Jannis Leidel
e41710616b Allow line breaks in config descriptions - Fix #95 2015-09-24 12:21:29 +02:00
Jannis Leidel
e1d27a6250 Merge remote-tracking branch 'chornsby/add-test-utils' 2015-09-24 11:59:55 +02:00
Jannis Leidel
b36aaf8fa6 More test fixes. 2015-09-24 11:56:19 +02:00
Jannis Leidel
19109b98bc Merge remote-tracking branch 'vinnyrose/compat_changes' 2015-09-24 11:02:45 +02:00
Jannis Leidel
f829ae543c Merge remote-tracking branch 'caktus/fixes_recent_djangos' 2015-09-24 10:45:14 +02:00
Mario Rosa
e1f9e52a08 Compatibility changes.
Drop python 2.6, 3.2
Drop Django 1.4, 1.5, 1.6
Remove models.py under constance and move to an appconfig imported file.
2015-08-25 08:14:01 -04:00
Dan Poirier
b44f5f5409 Some fixes for recent Djangos
* Add Django 1.8 to test environments in tox.ini
* Update python versions supported by Django master in tox.ini
* Don't load 'url' from template library 'future' - it is no longer
  available in Django master, and is not needed in Django 1.4 and later,
  which is as far back as django-constance tests
  * get_cache dropped from Django master
  * post_syncdb signal dropped
  * django.utils.importlib dropped

There are still errors on some environments that I didn't try to
address:

* coverage seems broken on py32
* django-master seems currently broken on py27 (non-ASCII character
somewhere,
I expect django-master will be fixed soon since they still claim py27
support)
* django14 seems broken: "NoReverseMatch: u"'admin" is not a registered
namespace"
2015-08-07 08:14:26 -04:00
Petr Dlouhý
12245b0f71 allow to override field config_type and set custom additional fields 2015-06-14 17:34:53 +02:00
Charlie Hornsby
3338d1c092 Implement override_config decorator for use in testing
Subclass django.test.utils.override_settings for similar pattern
Allow use as both TestCase decorator and context manager
Support Django versions 1.4 to 1.8
2015-06-02 21:18:19 +03:00
Curtis Maloney
353c6a30de Make 1.8 compatible 2015-05-27 13:23:28 +10:00
Igor Támara
f3604a3a73 master Added spanish translation 2015-01-15 16:39:04 -05:00
Jannis Leidel
8dfdc75334 Bumped version to 1.0.1. 2015-01-07 09:32:38 +01:00
Jannis Leidel
48704b9aa5 Try to fix #88 by being lazy a different way. 2015-01-06 12:24:58 +01:00
Jannis Leidel
d59e1c9c5f Use url tag from the future to fix rendering. 2014-12-04 18:20:00 -08:00
Jannis Leidel
880ece5cc1 1.0 \o/ 2014-12-04 17:24:51 -08:00
Jannis Leidel
2c03498d91 Fix minor cosmetic issue. 2014-12-04 16:45:24 -08:00
Jannis Leidel
d93dd7d2d9 Use breadcrumbs code from Django. 2014-12-04 16:38:50 -08:00
Jannis Leidel
13980f39a6 More laziness for preventing import time issues.
Fixes #84.
2014-12-04 10:37:10 -08:00
Jannis Leidel
7a6e0602d3 Use Django's own static template tag in the admin. 2014-12-04 10:36:29 -08:00
Jannis Leidel
cb2eacabc9 Pulled translations from Transifex. 2014-11-27 19:28:05 +01:00
Jannis Leidel
973963b70e Updated base translation message catalog. 2014-11-27 19:27:03 +01:00
Jannis Leidel
2cb825f3f6 Use better translated string. 2014-11-27 19:05:42 +01:00
Jannis Leidel
abd42df304 Minor cosmetic fix.
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2014-11-27 17:53:12 +01:00
Jannis Leidel
52cbce7a08 Stop requiring six as a depdendency.
This is possible now that we require at least a version of Django that ships with six.

Signed-off-by: Jannis Leidel <jannis@leidel.info>
2014-11-27 17:53:01 +01:00
Bouke Haarsma
d0fc64bf1a Hash settings to prevent overwriting of someone else's changes
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2014-11-27 17:51:12 +01:00
Jannis Leidel
1f958dc443 Make the config object lazy for old Djangos.
This should prevent import time side effects from instantiating the config object directly there.
2014-11-25 22:46:58 +01:00
Jannis Leidel
1b3ffbc049 Updated packaging setup. 2014-11-25 22:22:04 +01:00
Jannis Leidel
94e3989b9b Be a good Python citizen and call super. 2014-11-25 22:20:18 +01:00
Jannis Leidel
fc930442a2 Simplified settings. 2014-11-25 22:20:06 +01:00
Jannis Leidel
cd05239626 Because computers. 2014-11-21 21:19:14 +01:00
Jannis Leidel
ee0980a99f Raise an exception if an unsupported config type is used.
This is in response to #54 and #66.
2014-11-21 20:29:11 +01:00
Jannis Leidel
212dd67d18 Revert "add admin ui support for constance keys as lists"
This reverts commit cd3e84586d.
2014-11-21 20:24:16 +01:00
Jannis Leidel
6e2c4503e5 Moved South migrations out of the way and added Django migrations. 2014-11-21 20:21:17 +01:00
Jannis Leidel
69221ba2b4 Renamed config module to base to prevent ambiguity
This should fix #80 that is triggered by Django's new strickter import time loading process.
2014-11-21 20:16:39 +01:00
Jannis Leidel
8b0ed361d6 Added database cache autofill feature.
This refs #47 and #45.
2014-11-21 20:08:20 +01:00
Jannis Leidel
16bb8d50e6 Fix padding in admin table. 2014-11-21 19:46:15 +01:00
Jannis Leidel
51c25f5208 Fix an import error on Django master. 2014-11-21 17:48:40 +01:00
David Burke
6cca995b6b Merge branch 'patch-1' of git://github.com/LeaFin/django-constance into LeaFin-patch-1 2014-08-17 12:20:58 -04:00
Lin Xianyi
db43632907 Fixed AppRegistryNotReady exception on runserver on Django 1.7rc2. 2014-08-12 10:10:43 +08:00
David Burke
01c97eb019 Merge pull request #72 from wpj-cz/master
add Czech localization
2014-08-07 15:43:22 -04:00
vl
ecde8c7b11 Add translation to the app name 2014-08-07 13:15:22 +03:00
vl
789d71476a Fix one case 2014-08-07 12:03:32 +03:00
vl
243c9d35ba Russian translation 2014-08-07 11:56:19 +03:00