In my models, there is a many-to-many relationship between User and Store that she works for. After authenticated, if the user want to access a view that is specific to a store that she belongs to, a prerequisite action would be prompting her for the store she want to work with, unless she only belong to one store.
-- This prerequisite logic is very similar to loggin requirement. Is there a way i can implement this in a similar way as follow:
from braces.views import LoginRequiredMixin
class StoreSpecific_view(LoginRequiredMixin,generic.ListView):
model = StoreSpecificModel
I rather keep this logic away from the authentication process. Thank you for any suggestion or alternative solution.
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9df3118a-390b-44ca-8436-e6c4360c830c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment