Re: [Django] #23718: TEST_MIRROR setting doesn't work as expected (and has no tests)

2022-11-30 Thread Django
#23718: TEST_MIRROR setting doesn't work as expected (and has no tests)
-+-
 Reporter:  Ilya Baryshev|Owner:  Christian
 |  Bundy
 Type:  Bug  |   Status:  assigned
Component:  Documentation|  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  replica testing  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 #34193 was a duplicate.

-- 
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/01070184cbf492c0-22abcf92-582a-4c33-af48-2671f76158b0-00%40eu-central-1.amazonses.com.


Re: [Django] #34193: TestCase _fixture_teardown breaks database MIRROR usage

2022-11-30 Thread Django
#34193: TestCase _fixture_teardown breaks database MIRROR usage
---+--
 Reporter:  Jean-Daniel|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  4.1
 Severity:  Normal |   Resolution:  duplicate
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 I think it's a duplicate of #23718. `TEST['MIRROR']` requires
 `TransactionTestCase` to work with multiple databases.

-- 
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/01070184cbf4314d-d9035a8c-9b01-4cc8-af7d-ae3e7558549d-00%40eu-central-1.amazonses.com.


Re: [Django] #34194: Extract function for generating proper Content-Disposition headers

2022-11-30 Thread Django
#34194: Extract function for generating proper Content-Disposition headers
---+--
 Reporter:  Alex Vandiver  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  HTTP handling  |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Alex Vandiver):

 * Attachment "0001-Extract-function-for-generating-a-proper-Content-
 Dis.patch" added.

 Implementation, with tests

-- 
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/01070184ca2dd423-0f513ba1-4918-42f8-9524-020aef129bcc-00%40eu-central-1.amazonses.com.


[Django] #34194: Extract function for generating proper Content-Disposition headers

2022-11-30 Thread Django
#34194: Extract function for generating proper Content-Disposition headers
-+
   Reporter:  Alex Vandiver  |  Owner:  nobody
   Type:  New feature| Status:  new
  Component:  HTTP handling  |Version:  dev
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 Applications may need to generate Content-Disposition headers, and it
 seems a waste to duplicate the logic that already exists in FileResponse.
 Uses for this include things like `django-sendfile2`
 (https://github.com/moggers87/django-
 
sendfile2/blob/a13039aabbba05e50631804118a4d99db4f99ad4/django_sendfile/utils.py#L108-L118)
 and similar.

-- 
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/01070184ca2d4c5d-718ebfe6-9fcd-4ec9-b343-f13acefff6ba-00%40eu-central-1.amazonses.com.


Re: [Django] #34192: Callable storage on FileField fails to deconstruct when it returns default_storage

2022-11-30 Thread Django
#34192: Callable storage on FileField fails to deconstruct when it returns
default_storage
-+-
 Reporter:  Matt Westcott|Owner:  Francesco
 |  Panico
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   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 Francesco Panico):

 * owner:  nobody => Francesco Panico
 * 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/01070184ca0261fb-d71261a1-0d43-40bf-8190-5f9aec9b9be1-00%40eu-central-1.amazonses.com.


[Django] #34193: TestCase _fixture_teardown breaks database MIRROR usage

2022-11-30 Thread Django
#34193: TestCase _fixture_teardown breaks database MIRROR usage
-+
   Reporter:  Jean-Daniel|  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Testing framework  |Version:  4.1
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 The TestCase class _fixture_teardown() implementation try to iterate over
 all databases while it should ignore MIRROR databases.

 Trying to include MIRROR database in the iteration loop make the teardown
 be execute twice on the database and raise an exception.

 {{{
   for db_name in reversed(self._databases_names()):
 }}}


 Should be

 {{{
   for db_name in reversed(self._databases_names(include_mirrors=False)):
 }}}

-- 
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/01070184c946dda8-3d947f30-09dc-496e-bdd5-01db0852af3c-00%40eu-central-1.amazonses.com.


Re: [Django] #15049: Using annotation before and after filter gives wrong results

2022-11-30 Thread Django
#15049: Using annotation before and after filter gives wrong results
-+-
 Reporter:  Alex Gaynor  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   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 Abhinav Yadav):

 [https://github.com/django/django/pull/16273 PR]

 PR documenting this irregular behavior from the duplicate ticket #33403

-- 
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/01070184c92fd324-b76d9716-ede4-451c-9c0e-3698599c6bba-00%40eu-central-1.amazonses.com.


Re: [Django] #33199: Deprecate passing positional arguments to Signer.

2022-11-30 Thread Django
#33199: Deprecate passing positional arguments to Signer.
+-
 Reporter:  Daniel Samuels  |Owner:  Abhinav Yadav
 Type:  New feature |   Status:  assigned
Component:  Core (Other)|  Version:  dev
 Severity:  Normal  |   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 Abhinav Yadav):

 * owner:  (none) => Abhinav Yadav
 * needs_better_patch:  1 => 0
 * status:  new => assigned


Comment:

 [https://github.com/django/django/pull/16343 PR]

-- 
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/01070184c92c9b73-e7d13a31-a630-4d6f-9c5c-f50f047e9087-00%40eu-central-1.amazonses.com.


Re: [Django] #34095: Form controls in admin should use heights in relative units

2022-11-30 Thread Django
#34095: Form controls in admin should use heights in relative units
-+-
 Reporter:  Thibaud Colas|Owner:
 |  SwastikTripathi
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  4.1
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  accessibility| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by Mariusz Felisiak):

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


Comment:

 IMO we can consider this ticket as generally fixed. Small related cleanups
 are of course still welcome.

-- 
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/01070184c8b8051b-d6366d90-3474-4cc0-8073-e5e9a2ba4cb9-00%40eu-central-1.amazonses.com.


Re: [Django] #34095: Form controls in admin should use heights in relative units

2022-11-30 Thread Django
#34095: Form controls in admin should use heights in relative units
-+-
 Reporter:  Thibaud Colas|Owner:
 |  SwastikTripathi
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  accessibility| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"e20fd899be87cf70ed5c4372c7b2ee634da1453a" e20fd899]:
 {{{
 #!CommitTicketReference repository=""
 revision="e20fd899be87cf70ed5c4372c7b2ee634da1453a"
 Refs #34095 -- Changed more properties to use rem units in admin CSS.
 }}}

-- 
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/01070184c8b6fb90-75bdc94e-c36a-4d62-bd41-d02ce0b5d677-00%40eu-central-1.amazonses.com.


Re: [Django] #34192: Callable storage on FileField fails to deconstruct when it returns default_storage

2022-11-30 Thread Django
#34192: Callable storage on FileField fails to deconstruct when it returns
default_storage
-+-
 Reporter:  Matt Westcott|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   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):

 * component:  Migrations => Database layer (models, ORM)


Comment:

 We should probably use `getattr(self, "_storage_callable", self.storage)`
 in both lines.

-- 
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/01070184c89fd383-6ad17d79-6d36-4466-86f7-515f270c9b71-00%40eu-central-1.amazonses.com.


Re: [Django] #34192: Callable storage on FileField fails to deconstruct when it returns default_storage

2022-11-30 Thread Django
#34192: Callable storage on FileField fails to deconstruct when it returns
default_storage
---+
 Reporter:  Matt Westcott  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Migrations |  Version:  dev
 Severity:  Normal |   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 Carlton Gibson):

 * stage:  Unreviewed => Accepted


Comment:

 Yes, OK. That looks correct. We're essentially saying that when
 `hasattr(self, "_storage_callable")` that should unconditionally be used
 by `deconstruct`. 🤔

-- 
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/01070184c89c599b-483300a3-d6c6-4886-bc2a-2207f2efaf9a-00%40eu-central-1.amazonses.com.


Re: [Django] #34095: Form controls in admin should use heights in relative units

2022-11-30 Thread Django
#34095: Form controls in admin should use heights in relative units
-+-
 Reporter:  Thibaud Colas|Owner:
 |  SwastikTripathi
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  accessibility| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by Mariusz Felisiak):

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


Comment:

 [https://github.com/django/django/pull/16318 PR]

-- 
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/01070184c893f4f3-548b6a85-911b-4098-909e-f06bec1e19c2-00%40eu-central-1.amazonses.com.


Re: [Django] #33735: Add asynchronous responses for use with an ASGI server

2022-11-30 Thread Django
#33735: Add asynchronous responses for use with an ASGI server
+
 Reporter:  florianvazelle  |Owner:  (none)
 Type:  New feature |   Status:  new
Component:  HTTP handling   |  Version:  4.0
 Severity:  Normal  |   Resolution:
 Keywords:  ASGI async  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by Carlton Gibson):

 #32798 was the related duplicate.

-- 
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/01070184c87eacbd-9fd23822-f9e3-4666-b7c8-cc3cd6420ec2-00%40eu-central-1.amazonses.com.


Re: [Django] #32798: StreamingHttpResponse raises SynchronousOnlyOperation in ASGI server

2022-11-30 Thread Django
#32798: StreamingHttpResponse raises SynchronousOnlyOperation in ASGI server
+-
 Reporter:  Ralph Broenink  |Owner:  Michael Brown
 Type:  Bug |   Status:  closed
Component:  HTTP handling   |  Version:  3.2
 Severity:  Normal  |   Resolution:  duplicate
 Keywords:  ASGI, async | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-
Changes (by Carlton Gibson):

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


Comment:

 To simplify things I'm going to mark this as a duplicate of #33735 (which
 should be resolved by adding `__aiter__` to `StreamingHTTPResponse`)

-- 
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/01070184c87e5318-741a7af0-c6a7-4789-bfc1-35fcbeaffaff-00%40eu-central-1.amazonses.com.


[Django] #34192: Callable storage on FileField fails to deconstruct when it returns default_storage

2022-11-30 Thread Django
#34192: Callable storage on FileField fails to deconstruct when it returns
default_storage
-+
   Reporter:  Matt Westcott  |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Migrations |Version:  dev
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 If the `storage` argument on a FileField is set to a callable that returns
 `default_storage`, it is omitted from the deconstructed form of the field,
 rather than being included as a reference to the callable as expected.

 For example, given a model definition:

 {{{
 from django.core.files.storage import FileSystemStorage, default_storage
 from django.db import models
 import random


 other_storage = FileSystemStorage(location='/media/other')


 def get_storage():
 return random.choice([default_storage, other_storage])


 class MyModel(models.Model):
 my_file = models.FileField(storage=get_storage)
 }}}

 repeatedly running `makemigrations` will randomly generate a migration
 that alternately includes or omits `storage=myapp.models.get_storage` on
 the FileField definition.

 This case was overlooked in the fix for #31941 - the deconstruct method
 tests `if self.storage is not default_storage` to determine whether to add
 the `storage` kwarg, but at this point `self.storage` is the evaluated
 version, so it wrongly returns false for a callable that returns
 `default_storage`.

-- 
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/01070184c8797af4-88ca59bf-fee9-461e-bd00-49c930d7026a-00%40eu-central-1.amazonses.com.


Re: [Django] #34191: ModelAdmin.search_fields fails for DecimalField and __exact

2022-11-30 Thread Django
#34191: ModelAdmin.search_fields fails for DecimalField and __exact
-+-
 Reporter:  Klaas van Schelven   |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  contrib.admin|  Version:  3.2
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => duplicate
 * component:  Uncategorized => contrib.admin
 * type:  Uncategorized => Cleanup/optimization


Comment:

 Duplicate of #26001.

-- 
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/01070184c800b9a9-adf6684c-2c98-4055-b85f-fc3b6a580923-00%40eu-central-1.amazonses.com.


Re: [Django] #26001: Make ModelAdmin.search_fields raise data errors on __exact lookups for non-string fields.

2022-11-30 Thread Django
#26001: Make ModelAdmin.search_fields raise data errors on __exact lookups for 
non-
string fields.
--+
 Reporter:  Tim Graham|Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.admin |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Mariusz Felisiak):

 #34191 was a duplicate for `DecimalField`.

-- 
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/01070184c8009ce8-9ecf5511-3690-4ff7-a78b-04959a0ec9a9-00%40eu-central-1.amazonses.com.


Re: [Django] #26001: Make ModelAdmin.search_fields raise data errors on __exact lookups for non-string fields. (was: Make ModelAdmin.search_fields do an integer lookup for IntegerFields)

2022-11-30 Thread Django
#26001: Make ModelAdmin.search_fields raise data errors on __exact lookups for 
non-
string fields.
--+
 Reporter:  Tim Graham|Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.admin |  Version:  dev
 Severity:  Normal|   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 Mariusz Felisiak):

 * owner:  Nick Sandford => (none)
 * status:  assigned => new


-- 
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/01070184c7ffee41-0760d23a-d292-49c2-ac21-ac2078d1fb12-00%40eu-central-1.amazonses.com.


[Django] #34191: ModelAdmin.search_fields fails for DecimalField and __exact

2022-11-30 Thread Django
#34191: ModelAdmin.search_fields fails for DecimalField and __exact
--+
   Reporter:  Klaas van Schelven  |  Owner:  nobody
   Type:  Uncategorized   | Status:  new
  Component:  Uncategorized   |Version:  3.2
   Severity:  Normal  |   Keywords:
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
  UI/UX:  0   |
--+
 From the docs:

 > If you don’t want to use icontains as the lookup, you can use any lookup
 by appending it the field. For example, you could use exact by setting
 search_fields to ['first_name__exact']

 However, when I do this for any DecimalField, and enter any non-parsable
 (as a Decimal) value in the search box, I get the following:


 {{{
 Internal Server Error: /admin/valuta/redacted/
 Traceback (most recent call last):
   File "/lib/python3.10/site-
 packages/django/db/models/fields/__init__.py", line 1552, in to_python
 return decimal.Decimal(value)
 decimal.InvalidOperation: []

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/lib/python3.10/site-
 packages/django/core/handlers/exception.py", line 47, in inner
 response = get_response(request)
   File "/lib/python3.10/site-packages/django/core/handlers/base.py",
 line 181, in _get_response
 response = wrapped_callback(request, *callback_args,
 **callback_kwargs)
   File "/lib/python3.10/site-
 packages/django/contrib/admin/options.py", line 616, in wrapper
 return self.admin_site.admin_view(view)(*args, **kwargs)
   File "/lib/python3.10/site-packages/django/utils/decorators.py",
 line 130, in _wrapped_view
 response = view_func(request, *args, **kwargs)
   File "/lib/python3.10/site-
 packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
 response = view_func(request, *args, **kwargs)
   File "/lib/python3.10/site-packages/django/contrib/admin/sites.py",
 line 232, in inner
 return view(request, *args, **kwargs)
   File "/lib/python3.10/site-packages/django/utils/decorators.py",
 line 43, in _wrapper
 return bound_method(*args, **kwargs)
   File "/lib/python3.10/site-packages/django/utils/decorators.py",
 line 130, in _wrapped_view
 response = view_func(request, *args, **kwargs)
   File "/lib/python3.10/site-
 packages/django/contrib/admin/options.py", line 1697, in changelist_view
 cl = self.get_changelist_instance(request)
   File "/lib/python3.10/site-
 packages/django/contrib/admin/options.py", line 736, in
 get_changelist_instance
 return ChangeList(
   File "/lib/python3.10/site-
 packages/django/contrib/admin/views/main.py", line 99, in __init__
 self.queryset = self.get_queryset(request)
   File "/lib/python3.10/site-
 packages/django/contrib/admin/views/main.py", line 476, in get_queryset
 qs, search_may_have_duplicates = self.model_admin.get_search_results(
   File "/lib/python3.10/site-
 packages/django/contrib/admin/options.py", line 1032, in
 get_search_results
 queryset = queryset.filter(reduce(operator.or_, or_queries))
   File "/lib/python3.10/site-packages/django/db/models/query.py", line
 941, in filter
 return self._filter_or_exclude(False, args, kwargs)
   File "/lib/python3.10/site-packages/django/db/models/query.py", line
 961, in _filter_or_exclude
 clone._filter_or_exclude_inplace(negate, args, kwargs)
   File "/lib/python3.10/site-packages/django/db/models/query.py", line
 968, in _filter_or_exclude_inplace
 self._query.add_q(Q(*args, **kwargs))
   File "/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 1416, in add_q
 clause, _ = self._add_q(q_object, self.used_aliases)
   File "/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 1435, in _add_q
 child_clause, needed_inner = self.build_filter(
   File "/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 1288, in build_filter
 return self._add_q(
   File "/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 1435, in _add_q
 child_clause, needed_inner = self.build_filter(
   File "/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 1370, in build_filter
 condition = self.build_lookup(lookups, col, value)
   File "/lib/python3.10/site-packages/django/db/models/sql/query.py",
 line 1216, in build_lookup
 lookup = lookup_class(lhs, rhs)
   File "/lib/python3.10/site-packages/django/db/models/lookups.py",
 line 25, in __init__
 self.rhs = self.get_prep_lookup()
   File "/lib/python3.10/site-pack