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

Incorrect label of option returned by RelatedLookup view #1015

Closed
toshka opened this issue Mar 31, 2023 · 2 comments
Closed

Incorrect label of option returned by RelatedLookup view #1015

toshka opened this issue Mar 31, 2023 · 2 comments

Comments

@toshka
Copy link

toshka commented Mar 31, 2023

VERSIONS: Grappelli 3.0.5, Django 4.1
STATICFILES: OK
JAVASCRIPTS: OK
PYTHON BUG: TRUE

RelatedLookup view returns incorrect option label ("?") if ForeignKey has limit_choices_to attribute with IN statement.
Example:

class Category(models.Model):
    name = models.CharField("Title", max_length=50, unique=True)


class Entry(models.Model):
    title = models.CharField("Title", max_length=200)
    category = models.ForeignKey(Category, on_delete=models.SET_NULL, related_name="entries", blank=True, null=True, limit_choices_to={"id__in": [1, 2]})

The reason is the param query_string which is quoted.
It should be unquoted at RelatedLookup.get_filtered_queryset method.

toshka pushed a commit to toshka/django-grappelli that referenced this issue Mar 31, 2023
sehmaschine added a commit that referenced this issue Apr 5, 2023
Incorrect label of option returned by RelatedLookup view #1015
@toshka
Copy link
Author

toshka commented Apr 24, 2023

@sehmaschine is it possible to release 3.0.6 version?

@sehmaschine
Copy link
Owner

@toshka waiting for a couple of replies on existing issues (and pull-requests). planning on doing the release early next week.

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

No branches or pull requests

2 participants