Currently the `extra_context` kwarg is not used in `changelist_view`, it
is completely ignored. However, using it is a common idiom in a
`ModelAdmin` view method as a way to provide extra context variables to
an overridden template.
This is useful if one wants extra context variables in an overridden
`admin/constance/change_list.html` template.
* Adding support for using a subdirectory of MEDIA_ROOT for file fields with CONSTANCE_FILE_ROOT setting
* Improving documentation for CONSTANCE_FILE_ROOT
* Updating PR branch to work with latest master
* "failed to update live settings" message
* Update constance/locale/ru/LC_MESSAGES/django.po
* test fix
* fix .po/.mo
Co-authored-by: Alexandr Artemyev <mogost@gmail.com>
* made results table responsive for Django 2 admin
* make fieldsets collapsable
* updated version via feature
* fixed codestyle according to requested changes
* made results table responsive for Django 2 admin
Co-authored-by: Camilo Nova <camilo.nova@axiacore.com>
We need to store the actual name of the file, which the storage's save method provides. Otherwise, if we upload a new file with the same name as the already stored file has, the Constance config will keep a link to the old file.
* Add a Django system check that CONFIG_FIELDSETS accounts for all of CONFIG
* Fix test (don't actually modify values when submitting form) and restore python2 compatibility
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
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)
* 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