Skip to content
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

feat: add searching functionality in FAQ and add index to sorted m2m fields #4499

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

AfaqShuaib09
Copy link
Contributor

@AfaqShuaib09 AfaqShuaib09 commented Nov 28, 2024

PROD-3233

This PR adds search functionality to the FAQ model, allowing searches by id and question text. As many questions in the course_discovery can share the same text, I have added the primary key id to the admin list display for easier identification.

Additionally, I updated the __str__ method to include the index number alongside the question text in multiple select fields:
https://forum.djangoproject.com/t/rendering-with-checkboxselectmultiple/16410

Explored SortedCheckboxSelectMultiple from sortedm2m, but it doesn't have built-in functionality to include links with the rendered options. It simply uses the model's __str__ method for choices.

Screenshot:

Before:
No search before:
image

After:
image

After:
Before: I was simply question text with no index no.
image

@AfaqShuaib09 AfaqShuaib09 marked this pull request as ready for review November 29, 2024 07:52
@hamza-56 hamza-56 self-requested a review November 29, 2024 10:34
@AfaqShuaib09 AfaqShuaib09 merged commit f2ee31d into master Nov 29, 2024
14 checks passed
@AfaqShuaib09 AfaqShuaib09 deleted the afaq/prod-3233 branch November 29, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants