agateblue / django-dynamic-preferences

Dynamic global and instance settings for your django project
https://django-dynamic-preferences.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
348 stars 86 forks source link

NotFoundInRegistry #239

Open Bastilla123 opened 3 years ago

Bastilla123 commented 3 years ago

NotFoundInRegistry No such preference in GlobalPreferenceRegistry with section=None and name=addresslist_settings_url /home/sebastian/.local/lib/python3.8/site-packages/dynamic_preferences/registries.py, line 174, in get /usr/bin/python3 3.8.5 ['/home/sebastian/PycharmProjects/verwaltung', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/sebastian/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.8/dist-packages'] Sun, 21 Mar 2021 11:23:03 +0000

views.py: def updatesettings(request):

if request.method == "POST" and request.is_ajax():

url = request.GET.get("url", "?pagesize=50&ordering=id")

global_preferences['addresslist_settings_url'] = url

dynamic_preferences_registry.py:

from dynamic_preferences.types import BooleanPreference, StringPreference from dynamic_preferences.preferences import Section from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.users.registries import user_preferences_registry

save parameter behind url from addresslist

@user_preferences_registry.register class Addresslistsettings(StringPreference):

name = 'addresslist_settings_url'
default = "?pagesize=50&ordering=id"

The App have an entry in settings.App. In Database in table dynamic_preferences_users_userpreferencemodel there are no entry.

Why django create not a new entry in these table?

Regards