Commit graph

102 commits

Author SHA1 Message Date
Dmitry Karamin
45da6edd28 fix(admin): date type 2018-04-16 21:41:18 +03:00
Si Feng
1bec11477f Fix CONSTANCE_CONFIG_FIELDSETS mismatch issue 2018-03-13 16:56:00 -07:00
Anton Shurashov
40188c093a add config labels 2018-03-06 23:41:53 +03: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
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
7da7598291
Merge pull request #222 from JoshLabs/vb_validation_fix
Fixed #201
2017-11-06 11:47:22 -05:00
Camilo Nova
23e8557c83 Added file uploads. Fixes #141 and #241 2017-11-06 11:31:00 -05: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
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
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
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
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
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
bfc09f9982 Revert "Only set the attribute if value has changed"
This reverts commit 56fb550044.
2016-09-17 17:23:07 -05:00
Camilo Nova
56fb550044 Only set the attribute if value has changed 2016-09-17 15:18:29 -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
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
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
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
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
b36aaf8fa6 More test fixes. 2015-09-24 11:56:19 +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
Petr Dlouhý
12245b0f71 allow to override field config_type and set custom additional fields 2015-06-14 17:34:53 +02:00