Good day everyone, I've been stuck with a problem I am having and I can't find any help online.
-- I am trying to assign staffs to a particular role (Moderator, Instructor,....) using the FilteredSelectMultiple widget (Similar to Django Admin's assign permissions/groups). I have managed to display that widget on my site already (Each role has its own FSM widget where you select the staffs) but I'm not sure how to:
- Associate the widget to a role
- I've managed to display the FilteredSelectMultiple widgets on my site, that part is true. However, I'm not sure how to associate that widget to its own role. The items in the FSM widget are the staff's name, so role is actually empty.
- How to save into Database
- When I assign an item to the Chosen box, I want that to be saved to the database. If I remove, I want it to be deleted from the database
- I'm currently using a FormView and I'm not sure how to do this (Not good with Function based views and am more comfortable with CBVs)
- How do I have the chosen elements be displayed on the Chosen box the next time a user revisits the page?
Link to my code: https://gist.github.com/Yggralith0/1497cd9482e9b0cbd7d3d6a2ea8f977c
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5266e48f-c4ba-4523-b5a0-7fff609d9d6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment