-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As a user I want to be able to filter posts by role. #59
Comments
@mathiasbrito-dci @divyaChandran10 class PostViewSet(ModelViewSet):
queryset = Post.objects.all()
serializer_class = PostSerializer
def get_queryset(self):
search_term = self.request.query_params.get('search_terms')
if search_term:
queryset = Post.objects.filter(creator__username__icontains=search_term)
else:
queryset = Post.objects.all()
return queryset |
@mathiasbrito-dci shall we add an extra |
we need to think about it, I think we can find a solution without the need of having the role, for example, thinking real quick here, if we want to limit the search by student we can just search on the student table. |
I think, People in general will search any post by title regardless of the role. |
You mean we make new models for StudentPost, TeacherPost, InsitutionPost? |
The Issue is about viewing Students/Teacher/Institution posts by just clicking on some filter button. or a link . |
Yes I understood that, but since the role attribute is removed from models, can we do the common search of posts. If yes, we can change the issue as 'Search the posts by Title'. |
As a user, I must be able to retrieve a list of posts filtered by the creator's role. e.g., by teacher, by student, by researcher, etc.
The text was updated successfully, but these errors were encountered: