The Python Oracle

Django: storing user preferences

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Riding Sky Waves v001

--

Chapters
00:00 Question
01:03 Accepted answer (Score 0)
01:30 Answer 2 (Score 0)
01:59 Thank you

--

Full question
https://stackoverflow.com/questions/2157...

Accepted answer links:
[Django Formsets]: https://docs.djangoproject.com/en/3.1/to.../
[this Django Snippets article]: https://djangosnippets.org/snippets/1389/

Answer 2 links:
https://pypi.org/project/django-userpref.../

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #django #djangoforms

#avk47



ACCEPTED ANSWER

Score 0


If all your preferences values are Boolean, then yes, that way could be acceptable. And if you want to handle the PreferencesValues with Django Forms, you should take a look at Django Formsets.

But if you want to make something ajax-able, you should also take a look at this Django Snippets article.




ANSWER 2

Score 0


Can try using the package "django-userpreferences" https://pypi.org/project/django-userpreferences/ . I did not used it yet, but was researching on the similar requirement for capturing User Preferences, and got to know above link, hoping that will help others thus posted here. Will be using this soon to check how it works, and if it satisfy all my requirements.