Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-03-07 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Natalia Bidart):

 #35282 was a duplicate of this one.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e1a0d431c-49b51d07-0651-4f3d-96bb-5a9e2edb72ef-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-29 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Mariusz Felisiak ):

 In [changeset:"80761c3b01fbbbe2da1761937edd20251a86fbee" 80761c3b]:
 {{{#!CommitTicketReference repository=""
 revision="80761c3b01fbbbe2da1761937edd20251a86fbee"
 [5.0.x] Fixed #35198 -- Fixed facet filters crash on querysets with no
 primary key.

 Thanks Simon Alef for the report.

 Regression in 868e2fcddae6720d5713924a785339d1665f1bb9.

 Backport of a738281265bba5d00711ab62d4d37923764a27eb from main
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018df43a1d9b-fa4b2625-e2d9-4264-aad4-7f14a68f405e-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-29 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * resolution:   => fixed
 * status:  assigned => closed

Comment:

 In [changeset:"a738281265bba5d00711ab62d4d37923764a27eb" a7382812]:
 {{{#!CommitTicketReference repository=""
 revision="a738281265bba5d00711ab62d4d37923764a27eb"
 Fixed #35198 -- Fixed facet filters crash on querysets with no primary
 key.

 Thanks Simon Alef for the report.

 Regression in 868e2fcddae6720d5713924a785339d1665f1bb9.
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018df43a059f-c8516bbd-e062-43f3-94c4-a96be7df1fa5-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-29 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Ready for checkin

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018df3fa97b7-fed63ab0-1fdf-43ef-9abe-b0ec197b3774-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-27 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sarah Boyce):

 * needs_better_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018de9b67dfb-1ef9734d-cb11-49d4-b102-ef9ffaf1a3a0-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-19 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Shafiya Adzhani):

 * has_patch:  0 => 1

Comment:

 Here is the PR: https://github.com/django/django/pull/17880
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018dc2322089-55f16ecf-d62a-4c3d-b3d0-d1c86e9ac738-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-18 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Thomas Feldmann):

 Yes, kind of. The full filter is something like this:


 {{{#!python
 class RentalItemsFilter(admin.SimpleListFilter):
 title = "State"
 parameter_name = "rental_items_state"

 def lookups(self, request, model_admin):
 return [
 ("ACTIVE", "Active"),
 ("CANCELLED", "Cancelled"),
 ]

 def queryset(self, request, queryset):
 if not self.value():
 return queryset

 queryset = queryset.annotate(
 active_rental_item_count=Count(
 "contracts__rental_items",
 filter=Q(contracts__rental_items__cancel_date__isnull=True),
 distinct=True,
 ),
 cancelled_rental_item_count=Count(
 "contracts__rental_items",
 filter=Q(contracts__rental_items__cancel_date__isnull=False),
 distinct=True,
 ),
 )
 match self.value():
 case "ACTIVE":
 return queryset.filter(
 active_rental_item_count__gt=0,
 cancelled_rental_item_count=0
 )
 case "CANCELLED":
 return queryset.filter(
 active_rental_item_count=0,
 cancelled_rental_item_count__gt=0
 )
 case _:
 raise ValueError(f"Unknown value {self.value()}")
 }}}
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018dbbcefcfe-6d9fbabd-ca36-4a2f-94e4-552931b7b255-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-17 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Shafiya Adzhani):

 Replying to [comment:5 Thomas Feldmann]:
 > Hey, thanks a lot for tackling this! You're right, for this reproducer a
 RelatedFieldListFilter would be the way to go.
 > For the reproducer we stripped some business logic where we are
 annotating and filtering on the queryset, so I think we have to go with
 subclassing a SimpleListFilter here.

 ah, I understand. After I look at the reproducer, this reproducer intended
 to make categories like "ACTIVE" and "-" (not defined, data that are not
 in "ACTIVE"), right?
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018db74cc47e-4a19038c-dbb7-4c04-8b65-c2f3d0fb3b96-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-17 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Thomas Feldmann):

 Hey, thanks a lot for tackling this! You're right, for this reproducer a
 RelatedFieldListFilter would be the way to go.
 For the reproducer we stripped some business logic where we are annotating
 and filtering on the queryset, so I think we have to go with subclassing a
 SimpleListFilter here.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018db6d8c3ba-830813ab-e764-44cb-ada3-865a9ad1517b-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-16 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Shafiya Adzhani):

 Replying to [ticket:35198 Simon Alef]:
 > Description:
 > Our Django application defines a relational model where Customer
 entities have a one-to-many relationship with Contracts, and Contract
 entities have a one-to-many relationship with Rental Items. A custom admin
 filter (RentalItemsFilter) was implemented on the Customer model to enable
 filtering based on the presence of active Rental Items.
 >
 > Issue:
 > Using the "show counts" feature within the RentalItemsFilter on the
 Customer admin page to display counts of devices (Rental Items) associated
 with each customer through contracts triggers an exception.
 >
 > Steps to Reproduce:
 > Load fixtures from fixture.json
 > Go to the Django admin dashboard and navigate to the Customer model
 section.
 > Click on "Show counts".
 >
 >
 >
 > {{{
 > Traceback:
 > Request Method: GET
 > Request URL: http://127.0.0.1:8000/admin/demo/customer/?_facets=True
 >
 > Django Version: 5.0.2
 > Python Version: 3.11.7
 > Installed Applications:
 > ['django.contrib.admin',
 >  'django.contrib.auth',
 >  'django.contrib.contenttypes',
 >  'django.contrib.sessions',
 >  'django.contrib.messages',
 >  'django.contrib.staticfiles',
 >  'demo']
 > Installed Middleware:
 > ['django.middleware.security.SecurityMiddleware',
 >  'django.contrib.sessions.middleware.SessionMiddleware',
 >  'django.middleware.common.CommonMiddleware',
 >  'django.middleware.csrf.CsrfViewMiddleware',
 >  'django.contrib.auth.middleware.AuthenticationMiddleware',
 >  'django.contrib.messages.middleware.MessageMiddleware',
 >  'django.middleware.clickjacking.XFrameOptionsMiddleware']
 >
 >
 > Template error:
 > In template /django_bug_report/.venv/lib/python3.11/site-
 packages/django/contrib/admin/templates/admin/change_list.html, error at
 line 87
 >no such column: demo_rentalitem.id
 >77 : {% translate 'Filter' %}
 >78 : {% if cl.is_facets_optional or cl.has_active_filters
 %}
 >79 :   {% if cl.is_facets_optional %}
 >80 : {% if cl.add_facets %}{% translate "Hide counts"
 %}
 >81 : {% else %}{% translate "Show counts" %}{% endif %}
 >82 :   {% endif %}
 >83 :   {% if cl.has_active_filters %}
 >84 : 
 {% translate "Clear all filters" %}
 >85 :   {% endif %}
 >86 : {% endif %}
 >87 : {% for spec in cl.filter_specs %} {%
 admin_list_filter cl spec %} {% endfor %}
 >88 :   
 >89 : {% endif %}
 >90 :   {% endblock %}
 >91 : 
 >92 :   
 >93 : {% endblock %}
 >94 :
 >
 > Traceback (most recent call last):
 >   File "/django_bug_report/.venv/lib/python3.11/site-
 packages/django/db/backends/utils.py", line 105, in _execute
 > return self.cursor.execute(sql, params)
 >
 >   File "/django_bug_report/.venv/lib/python3.11/site-
 packages/django/db/backends/sqlite3/base.py", line 329, in execute
 > return super().execute(query, params)
 >^^
 >
 > The above exception (no such column: demo_rentalitem.id) was the direct
 cause of the following exception:
 >   File "/django_bug_report/.venv/lib/python3.11/site-
 packages/django/core/handlers/exception.py", line 55, in inner
 > response = get_response(request)
 >^
 >   File "/django_bug_report/.venv/lib/python3.11/site-
 packages/django/core/handlers/base.py", line 220, in _get_response
 > response = response.render()
 >^
 >   File "/django_bug_report/.venv/lib/python3.11/site-
 packages/django/template/response.py", line 114, in render
 > self.content = self.rendered_content
 >^
 >   File "/django_bug_report/.venv/lib/python3.11/site-
 packages/django/template/response.py", line 92, in rendered_content
 > return template.render(context, self._request)
 >^^^
 >   File "/django_bug_report/.venv/lib/python3.11/site-
 

Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-16 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Shafiya Adzhani):

 * Attachment "screenshot-related-list-filter.png" added.

 Screenshot of Related List Filter on reported apps
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018db5a7f184-f38a8b2d-b4b1-4cf5-8abc-ffda2908bb87-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID.

2024-02-16 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+-
 Reporter:  Simon Alef   |Owner:  Shafiya
 |  Adzhani
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Shafiya Adzhani):

 * owner:  nobody => Shafiya Adzhani
 * status:  new => assigned

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018db30c50be-67ececf1-35dd-4eb4-9553-fd7a94ee9883-00%40eu-central-1.amazonses.com.


Re: [Django] #35198: Facet filters crash for queryset with no ID. (was: Django Admin "Show counts" Feature Triggers Exception in a Custom Filter)

2024-02-16 Thread Django
#35198: Facet filters crash for queryset with no ID.
-+
 Reporter:  Simon Alef   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  5.0
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Mariusz Felisiak):

 * cc: Sarah Boyce (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted
 * summary:
 Django Admin "Show counts" Feature Triggers Exception in a Custom
 Filter
 => Facet filters crash for queryset with no ID.

Comment:

 Thanks for the report. Regression in
 868e2fcddae6720d5713924a785339d1665f1bb9.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018db1e2b17f-26238c52-db36-473d-83ee-779f813d6fff-00%40eu-central-1.amazonses.com.