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

Can't filter notes by capitalized tags #467

Closed
Alberdi opened this issue Jun 3, 2022 · 4 comments · Fixed by #480
Closed

Can't filter notes by capitalized tags #467

Alberdi opened this issue Jun 3, 2022 · 4 comments · Fixed by #480
Labels
bug Reports of unexpected problems or errors good first issue Good candidates for simple work for first time contributors

Comments

@Alberdi
Copy link
Contributor

Alberdi commented Jun 3, 2022

I want to thank everyone involved in the new tag support; it's very useful!

When I try to filter the "Notes" by tag it doesn't find any:
https://user-images.githubusercontent.com/1556349/171914065-0a6f5462-7dda-4088-9ecb-e0748f75b706.mov

@cdubz
Copy link
Member

cdubz commented Jun 4, 2022

Interesting. I can't reproduce this in the demo. Does the filtering work for tags in other entry types?

@cdubz cdubz added the need more info Needs more information from issue poster label Jun 4, 2022
@Alberdi Alberdi changed the title Can't filter notes by tags Can't filter notes by capitalized tags Jun 5, 2022
@Alberdi
Copy link
Contributor Author

Alberdi commented Jun 5, 2022

It only seems to happen when the tag has the first letter capitalized! Also in other entry types.

@Alberdi
Copy link
Contributor Author

Alberdi commented Jun 5, 2022

I guess it happens when the name of the tag doesn't match the internal slug. Maybe related to this:

tag = django_filters.ModelChoiceFilter(
label=_("Tag"),
field_name="tags__slug",
to_field_name="slug",
distinct=True,
queryset=models.Tag.objects.all().order_by("name"),
)

@cdubz
Copy link
Member

cdubz commented Jun 5, 2022

Nice — thanks for figuring that out. I can reproduce as well.

@cdubz cdubz added bug Reports of unexpected problems or errors good first issue Good candidates for simple work for first time contributors and removed need more info Needs more information from issue poster labels Jun 5, 2022
Alberdi added a commit to Alberdi/babybuddy that referenced this issue Jun 11, 2022
Now the filter uses exclusively the name field.

Closes babybuddy#467.
cdubz pushed a commit that referenced this issue Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reports of unexpected problems or errors good first issue Good candidates for simple work for first time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants