Re: [Django] #20757: A more Object-Oriented URLResolver

2024-03-07 Thread Django
#20757: A more Object-Oriented URLResolver
+
 Reporter:  Flavio Curella  |Owner:  (none)
 Type:  New feature |   Status:  new
Component:  Core (URLs) |  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 Mariusz Felisiak):

 * owner:  Marten Kenbeek => (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/0107018e1d1331f6-1c353998-88b0-48fd-acb1-3ea57bb1ca73-00%40eu-central-1.amazonses.com.


Re: [Django] #31014: add FromWKB and FromWKT GIS functions

2024-03-07 Thread Django
#31014: add FromWKB and FromWKT GIS functions
-+
 Reporter:  Sergey Fedoseev  |Owner:  (none)
 Type:  New feature  |   Status:  new
Component:  GIS  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  wkt, wkb | 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):

 * owner:  Mariusz Felisiak => (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/0107018e1cfa6887-a7a49756-4ee4-4694-b4a6-7b4a97d2b40f-00%40eu-central-1.amazonses.com.


Re: [Django] #35283: Dynamic admin site titles

2024-03-07 Thread Django
#35283: Dynamic admin site titles
---+
 Reporter:  Kasun Herath   |Owner:  Kasun Herath
 Type:  New feature|   Status:  closed
Component:  contrib.admin  |  Version:  dev
 Severity:  Normal |   Resolution:  wontfix
 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):

 * easy:  1 => 0
 * resolution:   => wontfix
 * status:  assigned => closed

Comment:

 Thanks for the ticket, however, Django Admin is not a
 [https://docs.djangoproject.com/en/stable/ref/contrib/admin/#module-
 django.contriab.admin universal tool for building an app] and adding a new
 option/method to the `AdminSite` is always controversial (we already have
 many of them). I think it's a bit of a niche case. Also, you should be
 able to achieve the same by overriding `AdminSite.each_context()`.

 Please first start a discussion on the DevelopersMailingList, where you'll
 reach a wider audience and see what other think, and
 [https://docs.djangoproject.com/en/stable/internals/contributing/triaging-
 tickets/#closing-tickets follow the triaging guidelines with regards to
 wontfix tickets].
-- 
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/0107018e1cce22a1-6b14f453-c82f-4ade-a7fc-ca46ad0e8bb7-00%40eu-central-1.amazonses.com.


Re: [Django] #35280: iriencode example incorrect

2024-03-07 Thread Django
#35280: iriencode example incorrect
---+
 Reporter:  minusf |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Documentation  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+
Comment (by Can Huynh):

 I would love to help if @minusf couldn't allocate the time. Lmk!
-- 
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/0107018e1cb7d704-f37e35b0-31b2-4ddd-9df9-1a98addb0e73-00%40eu-central-1.amazonses.com.


Re: [Django] #28541: migration introducing a UUID primary key fails on sqlite3

2024-03-07 Thread Django
#28541: migration introducing a UUID primary key fails on sqlite3
+
 Reporter:  karyon  |Owner:  bcail
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.11
 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):

 * 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/0107018e1ca3d2e0-aae366f7-375c-47bb-9afe-e512424041ec-00%40eu-central-1.amazonses.com.


Re: [Django] #35270: Optimize Model._meta._property_names

2024-03-07 Thread Django
#35270: Optimize Model._meta._property_names
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   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):

 * 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/0107018e1c9a930c-e0683949-283b-4c20-bb6f-5bc7a394152a-00%40eu-central-1.amazonses.com.


Re: [Django] #35223: Fields with db_default raise ValidationErrors when full_clean() called

2024-03-07 Thread Django
#35223: Fields with db_default raise ValidationErrors when full_clean() called
-+-
 Reporter:  Brian Ibbotson   |Owner:  bcail
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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:"5f07460a67825bfc3f0129feec94a24bbf6d2a5f" 5f07460a]:
 {{{#!CommitTicketReference repository=""
 revision="5f07460a67825bfc3f0129feec94a24bbf6d2a5f"
 [5.0.x] Fixed #35223 -- Made Model.full_clean() ignore fields with
 db_default when validating empty values.

 Thanks Brian Ibbotson for the report.

 Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.

 Backport of 1570ef02f34037d32218d463342592debccf915c 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/0107018e1c9a2837-bcdc5eec-3b47-4a7d-883d-29bc33fa2dad-00%40eu-central-1.amazonses.com.


Re: [Django] #35223: Fields with db_default raise ValidationErrors when full_clean() called

2024-03-07 Thread Django
#35223: Fields with db_default raise ValidationErrors when full_clean() called
-+-
 Reporter:  Brian Ibbotson   |Owner:  bcail
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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:"1570ef02f34037d32218d463342592debccf915c" 1570ef0]:
 {{{#!CommitTicketReference repository=""
 revision="1570ef02f34037d32218d463342592debccf915c"
 Fixed #35223 -- Made Model.full_clean() ignore fields with db_default when
 validating empty values.

 Thanks Brian Ibbotson for the report.

 Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
 }}}
-- 
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/0107018e1c97f097-cf3ddf8a-87d2-4f75-ba34-631c348f01dd-00%40eu-central-1.amazonses.com.


[Django] #35283: Dynamic admin site titles

2024-03-07 Thread Django
#35283: Dynamic admin site titles
-+--
   Reporter:  Kasun Herath   |  Owner:  Kasun Herath
   Type:  New feature| Status:  assigned
  Component:  contrib.admin  |Version:  dev
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+--
 AdminSite
 [https://github.com/django/django/blob/main/django/contrib/admin/sites.py#L29]
 has attributes defined that can be used to customize admin site_header,
 site_title and index_title.

 But these cannot be populated dynamically. I propose to add three method
 like below, that would enable populating site_header, site_title and
 index_title dynamically.

 {{{
  def get_site_header(request, *args, **kwargs):
 # return computed site_header
 }}}
-- 
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/0107018e1c90-32b2c0b3-4b46-4264-9853-0002bfccc049-00%40eu-central-1.amazonses.com.


Re: [Django] #35257: db.models.expressions _connector_combinations for Numeric with NULL returns only FloatField instead of (IntegerField, DecimalField, FloatField)

2024-03-07 Thread Django
#35257: db.models.expressions _connector_combinations for Numeric with NULL 
returns
only FloatField instead of (IntegerField, DecimalField, FloatField)
-+-
 Reporter:  Sharon Woo   |Owner:  Sharon
 |  Woo
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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):

 * 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/0107018e1c8affa7-f6f2210b-162a-45b3-bfe1-873ea9f801e8-00%40eu-central-1.amazonses.com.


Re: [Django] #35279: Memory Leak with `prefetch_related`

2024-03-07 Thread Django
#35279: Memory Leak with `prefetch_related`
-+-
 Reporter:  Ken Tong |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  memory leak  | 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):

 * stage:  Accepted => Unreviewed

Comment:

 TIL
-- 
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/0107018e1c6e4bb5-e45c970f-60f4-4fee-98f1-cb49b6dc1803-00%40eu-central-1.amazonses.com.


Re: [Django] #30397: Allow app_label and class to be specified in the name argument for indexes and constraints.

2024-03-07 Thread Django
#30397: Allow app_label and class to be specified in the name argument for 
indexes
and constraints.
-+-
 Reporter:  Mariusz Felisiak |Owner:  Can
 |  Sarıgöl
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by GitHub ):

 In [changeset:"1669e54965e22d9bfd0cc8f8fb969704ac608163" 1669e549]:
 {{{#!CommitTicketReference repository=""
 revision="1669e54965e22d9bfd0cc8f8fb969704ac608163"
 Refs #30397 -- Optimized interpolation of index and constraint names a bit
 more.
 }}}
-- 
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/0107018e1c653102-d001da18-ba6e-4873-ba5c-9355fc5a8801-00%40eu-central-1.amazonses.com.


Re: [Django] #35279: Memory Leak with `prefetch_related`

2024-03-07 Thread Django
#35279: Memory Leak with `prefetch_related`
-+-
 Reporter:  Ken Tong |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  memory leak  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Ken Tong):

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

-- 
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/0107018e1c0b4cc1-82aa4ec9-bff3-4611-861b-3d2f423c6639-00%40eu-central-1.amazonses.com.


Re: [Django] #35279: Memory Leak with `prefetch_related`

2024-03-07 Thread Django
#35279: Memory Leak with `prefetch_related`
-+-
 Reporter:  Ken Tong |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  memory leak  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Ken Tong):

 Thank you for your detailed explanation, Antoine. I confirm that memory
 leak is a false alarm and I am sorry about it
-- 
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/0107018e1c0a593d-56865a2b-f604-4051-bb26-f16fd004a1bb-00%40eu-central-1.amazonses.com.


Re: [Django] #35270: Optimize Model._meta._property_names

2024-03-07 Thread Django
#35270: Optimize Model._meta._property_names
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 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
-+-
Comment (by Adam Johnson):

 Alright, updated.
-- 
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/0107018e1b19d775-8b270711-bf87-46cd-bb37-4776c34cac93-00%40eu-central-1.amazonses.com.


Re: [Django] #28541: migration introducing a UUID primary key fails on sqlite3

2024-03-07 Thread Django
#28541: migration introducing a UUID primary key fails on sqlite3
+
 Reporter:  karyon  |Owner:  bcail
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.11
 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 bcail):

 * cc: bcail (added)
 * has_patch:  0 => 1
 * owner:  nobody => bcail
 * status:  new => assigned

Comment:

 I opened [https://github.com/django/django/pull/17950 a 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/0107018e1aa8a3fd-8ead061c-a1ee-4cd2-a9d5-4eb7fceb1d8a-00%40eu-central-1.amazonses.com.


Re: [Django] #35270: Optimize Model._meta._property_names

2024-03-07 Thread Django
#35270: Optimize Model._meta._property_names
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 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 Natalia Bidart):

 * stage:  Unreviewed => Accepted

Comment:

 Replying to [comment:4 Adam Johnson]:
 [...]
 > The result was that the calls took 2ms, keeping most of the savings.
 That said, the project I’m using doesn’t have deep model inheritance or
 many mixins, so we wouldn’t expect the caching to do so much.
 >
 > If you’d both prefer this version, sure, we can go for it. Best to keep
 things maintainable for all, and we can always add `@weak_key_cache` or
 similar in the future.

 I'm very much in favor of a simpler optimization. I agree with Keryn that
 `@weak_key_cache` is the kind of deep magic is not fully understood
 immediately.
 Accepting following this simplification proposal.
-- 
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/0107018e1a15ee65-bb13ced3-1ff2-4fdd-ae78-78930c0406bb-00%40eu-central-1.amazonses.com.


Re: [Django] #34977: Turn link to change password form in admin user change form into a button

2024-03-07 Thread Django
#34977: Turn link to change password form in admin user change form into a 
button
-+-
 Reporter:  Fabian Braun |Owner:  Fabian
 Type:   |  Braun
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.auth |  Version:  4.2
 Severity:  Normal   |   Resolution:
 Keywords:  accessibility| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  1
-+-
Changes (by Natalia Bidart):

 * needs_better_patch:  0 => 1

Comment:

 Setting as patch needs improvement until conflicts are solved and the PR
 is reviewable again.
-- 
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/0107018e1a11d4ed-041d0484-bb77-454d-bbf4-dbbb5b9c240b-00%40eu-central-1.amazonses.com.


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] #35282: ProgrammingError when admin.ShowFacets.ALWAYS and filter in list_filter of type SimpleListFilter on search.

2024-03-07 Thread Django
#35282: ProgrammingError when admin.ShowFacets.ALWAYS and filter in list_filter 
of
type SimpleListFilter on search.
--+--
 Reporter:  zaterio   |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  contrib.admin |  Version:  5.0
 Severity:  Normal|   Resolution:  duplicate
 Keywords:  SimpleListFilter  | Triage Stage:  Unreviewed
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by Natalia Bidart):

 * keywords:  ShowFacets SimpleListFilter => SimpleListFilter
 * resolution:   => duplicate
 * status:  new => closed
 * type:  Uncategorized => Bug

Comment:

 Duplicate of #35198.
-- 
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/0107018e1a0cfde6-e46932f0-7436-4977-8953-21c7dccc71f7-00%40eu-central-1.amazonses.com.


Re: [Django] #35282: ProgrammingError when admin.ShowFacets.ALWAYS and filter in list_filter of type SimpleListFilter on search.

2024-03-07 Thread Django
#35282: ProgrammingError when admin.ShowFacets.ALWAYS and filter in list_filter 
of
type SimpleListFilter on search.
-+-
 Reporter:  zaterio  |Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  contrib.admin|  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:  ShowFacets   | Triage Stage:
  SimpleListFilter   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by zaterio):

 Upgrading from django-5.0.2 to django-5.0.3, resolves the issue.
-- 
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/0107018e19f9725c-c99b94c3-a30f-4993-a387-367235c8fe5f-00%40eu-central-1.amazonses.com.


[Django] #35282: ProgrammingError when admin.ShowFacets.ALWAYS and filter in list_filter of type SimpleListFilter on search.

2024-03-07 Thread Django
#35282: ProgrammingError when admin.ShowFacets.ALWAYS and filter in list_filter 
of
type SimpleListFilter on search.
-+-
   Reporter:  zaterio|  Owner:  nobody
   Type: | Status:  new
  Uncategorized  |
  Component: |Version:  5.0
  contrib.admin  |   Keywords:  ShowFacets
   Severity:  Normal |  SimpleListFilter
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Hello,

 admin configuration:
 {{{
 class EstadosListFilter(admin.SimpleListFilter):
 title = _("Estados Licitación")
 parameter_name = "cantidad_estados"

 def lookups(self, request, model_admin):
 return [
 ("1", _("1")),
 ("2", _("2")),
 ]

 def queryset(self, request, queryset):
 if self.value() == "1":
 return queryset.filter(_cantidad_estados=1)
 elif self.value() == "2":
 return queryset.filter(_cantidad_estados=2)
 return queryset


 @admin.register(Licitaciones)
 class LicitacionesAdmin(admin.ModelAdmin):
 ordering = ["created_at"]

 exclude = ['user', 'file_path']

 list_display = ['CodigoExterno', 'empresa__NombreEmpresa', 'date',
 'CodigoEstado', 'FechaCierre', 'Nombre',
 'cantidad_productos', 'cantidad_items',]

 search_fields = ["CodigoExterno", 'empresa__NombreEmpresa',
 "productos__NombreProducto",
  'licitacion_proveedores__NombreProveedor']

 inlines = [ProveedoresInline, LicitacionesDetallesActiveInline,
LicitacionesDetallesNoActiveInline, ItemsActiveInline,
 ItemsNoActiveInline]

 list_filter = (
 "CodigoEstado", ('date', admin.DateFieldListFilter),
 EstadosListFilter)

 show_facets = admin.ShowFacets.ALWAYS

 def get_queryset(self, request):
 cantidad_productos_subq =
 Licitaciones.objects.filter(CodigoExterno=OuterRef(
 
"CodigoExterno")).annotate(__cantidad_productos=Count('productos')).values('__cantidad_productos')

 cantidad_estados_subq =
 Licitaciones.objects.filter(CodigoExterno=OuterRef("CodigoExterno")).annotate(
 __cantidad_estados=Count('licitacion_detalle')).values('__cantidad_estados')

 cantidad_items_subq =
 Licitaciones.objects.filter(CodigoExterno=OuterRef("CodigoExterno")).annotate(
 __cantidad_items=Count('licitacion_items',
 filter=Q(licitacion_items__active=True))).values('__cantidad_items')

 ''' solo muestra licitaciones a las cuales se les ha traido el
 detallle'''
 qs = super(LicitacionesAdmin, self).get_queryset(
 request).filter(licitacion_detalle__isnull=False)

 qs = qs.annotate(
 _cantidad_productos=Subquery(cantidad_productos_subq),
 _cantidad_estados=Subquery(cantidad_estados_subq),
 _cantidad_items=Subquery(cantidad_items_subq)
 )
 return qs

 def cantidad_productos(self, obj):
 return obj._cantidad_productos
 cantidad_productos.short_description = 'Productos'
 cantidad_productos.admin_order_field = '_cantidad_productos'

 def cantidad_items(self, obj):
 return obj._cantidad_items
 cantidad_items.short_description = 'Items'
 cantidad_items.admin_order_field = '_cantidad_items'

 def cantidad_estados(self, obj):
 return obj._cantidad_estados
 cantidad_estados.short_description = 'Estados'
 cantidad_estados.admin_order_field = '_cantidad_estados'

 def empresa__NombreEmpresa(self, obj):
 return obj.empresa.NombreEmpresa
 empresa__NombreEmpresa.short_description = 'Razón Social'
 }}}

 At this point, LicitacionesAdmin, correctly displays EstadosListFilter and
 its number of facets in change_list view. But when performing a search, it
 throws the following error:

 {{{
 ProgrammingError at /admin/mpublico/licitaciones/

 invalid reference to FROM-clause entry for table "mpublico_licitaciones"
 LINE 1: ...= U1."licitacion_id") WHERE U0."CodigoExterno" = ("mpublico_...
  ^
 HINT:  Perhaps you meant to reference the table alias "u0".
 }}}

 But changing to:

 {{{
 show_facets = admin.ShowFacets.NEVER
 }}}

 Performs the search without any errors

 On the other hand, when the option is set to ALLOW,  search also works,
 the error in this case appears when clicking on show facets
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this 

Re: [Django] #35279: Memory Leak with `prefetch_related`

2024-03-07 Thread Django
#35279: Memory Leak with `prefetch_related`
-+-
 Reporter:  Ken Tong |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  memory leak  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Antoine Humbert):

 The following code snippet shows the same result:

 {{{

 import gc


 class Parent:

 def __init__(self):
 self.cache = {}


 class Child:

 def __init__(self, parent):
 self.parent = parent



 def test():
 foo = Parent()
 bar = Child(parent=foo)
 foo.cache["bars"] = [bar]
 print(foo.cache, bar.parent)


 test()
 gc.collect()
 print(len(gc.garbage))

 gc.set_debug(gc.DEBUG_LEAK)
 gc.collect()
 print(len(gc.garbage))

 test()
 gc.collect()
 print(len(gc.garbage))
 }}}

 Results in following output

 {{{
 {'bars': [<__main__.Child object at 0x6f520cdd90>]} <__main__.Parent
 object at 0x6f520cd6d0>
 0
 0
 {'bars': [<__main__.Child object at 0x6f520b32d0>]} <__main__.Parent
 object at 0x6f520b1fd0>
 gc: collectable 
 gc: collectable 
 gc: collectable 
 gc: collectable 
 4
 }}}

 Removing the `gc.set_debug` statement, the `gc.garbage` is always empty,
 so it looks like à side effect of `DEBUG_LEAK`.

 As per the `gc` documentation:

 {{{
 To debug a leaking program call gc.set_debug(gc.DEBUG_LEAK). Notice that
 this includes gc.DEBUG_SAVEALL, causing garbage-collected objects to be
 saved in gc.garbage for inspection.
 }}}

 So, using `DEBUG_LEAK` leads to collected objects to be present in
 gc.garbage. So, I would say that looking at `gc.garbage` in this case does
 not identifies a memory leak. On the contrary, it shows objects that were
 garbage collected
-- 
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/0107018e19d62d2e-5094eb02-7637-4d38-b9a5-90d10ac10694-00%40eu-central-1.amazonses.com.


[Django] #35281: Use HTTP 413 status code for RequestDataTooBig

2024-03-07 Thread Django
#35281: Use HTTP 413 status code for RequestDataTooBig
-+
   Reporter:  zvyn   |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  HTTP handling  |Version:  5.0
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+
 Other HTTP servers (e.g. Apache, Nginx) report a body which is to large
 with the status code 413 "Payload Too Large".

 I propose to do the same in Django when handling a RequestDataTooBig
 exception in
 
https://github.com/django/django/blob/f931cbec21cce3e2e68239c77614e6aa5026b882/django/core/handlers/exception.py#L63

 This makes the behavior of a typical stack consisting of a reverse proxy
 and a Django project predictable for this type of error.

 I can work on a patch if this change is acceptable to you.
-- 
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/0107018e192fdff9-2e43b1cf-3619-4b09-84b4-4cc012095da8-00%40eu-central-1.amazonses.com.


Re: [Django] #35273: AdminFileWidget renders two elements with the same ID

2024-03-07 Thread Django
#35273: AdminFileWidget renders two elements with the same ID
-+-
 Reporter:  Johannes Maron   |Owner:  Johannes
 |  Maron
 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 Johannes Maron):

 * owner:  nobody => Johannes Maron
 * status:  new => assigned

Comment:

 I write a full patch tomorrow and check if we have other widgets that
 include the same problem.
-- 
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/0107018e1908495d-987d8ab3-0091-42b4-a2c4-c942cdf74259-00%40eu-central-1.amazonses.com.


Re: [Django] #35280: iriencode example incorrect

2024-03-07 Thread Django
#35280: iriencode example incorrect
---+
 Reporter:  minusf |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Documentation  |  Version:  5.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted

Comment:

 Good catch, we could use an example from the docstring, `'/I ♥ Django/`.
 Would you like to prepare a patch?
-- 
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/0107018e18ecf551-bc9a1363-93c4-4a02-a108-bbfeff5079d5-00%40eu-central-1.amazonses.com.


Re: [Django] #35223: Fields with db_default raise ValidationErrors when full_clean() called

2024-03-07 Thread Django
#35223: Fields with db_default raise ValidationErrors when full_clean() called
-+-
 Reporter:  Brian Ibbotson   |Owner:  bcail
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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):

 * owner:  Damir Nafikov => bcail
 * 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/0107018e18e97779-1e1373b5-3f7e-4faf-9bbe-2318672a2162-00%40eu-central-1.amazonses.com.


Re: [Django] #35223: Fields with db_default raise ValidationErrors when full_clean() called

2024-03-07 Thread Django
#35223: Fields with db_default raise ValidationErrors when full_clean() called
-+-
 Reporter:  Brian Ibbotson   |Owner:  Damir
 Type:   |  Nafikov
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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
-+-
Comment (by Mariusz Felisiak):

 Bug in 414704e88d73dafbcfbb85f9bc54cb6111439d3.
-- 
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/0107018e18e08cb9-3339a400-8fea-421e-bd5f-74d1b29cd399-00%40eu-central-1.amazonses.com.


Re: [Django] #35223: Fields with db_default raise ValidationErrors when full_clean() called

2024-03-07 Thread Django
#35223: Fields with db_default raise ValidationErrors when full_clean() called
-+-
 Reporter:  Brian Ibbotson   |Owner:  Damir
 Type:   |  Nafikov
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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 Mariusz Felisiak):

 * severity:  Normal => Release blocker

Comment:

 Bumping to a release blocker as `Model.full_clean()` crashes on some
 expressions, e.g.
 {{{
   File "/django/tests/field_defaults/tests.py", line 175, in
 test_full_clean
 obj.full_clean()
   File "/django/django/db/models/base.py", line 1586, in full_clean
 self.clean_fields(exclude=exclude)
   File "/django/django/db/models/base.py", line 1641, in clean_fields
 setattr(self, f.attname, f.clean(raw_value, self))
   File "/django/django/db/models/fields/__init__.py", line 830, in clean
 value = self.to_python(value)
   File "/django/django/db/models/fields/__init__.py", line 1620, in
 to_python
 parsed = parse_datetime(value)
   File "/django/django/utils/dateparse.py", line 114, in parse_datetime
 return datetime.datetime.fromisoformat(value)
 TypeError: fromisoformat: argument must be str
 }}}
-- 
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/0107018e18db1c76-82a9ef85-c4af-4b9a-bceb-9f07576958ba-00%40eu-central-1.amazonses.com.


[Django] #35280: iriencode example incorrect

2024-03-07 Thread Django
#35280: iriencode example incorrect
-+
   Reporter:  minusf |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Documentation  |Version:  5.0
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  1
  UI/UX:  0  |
-+
 https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#iriencode

   If value is "?test=1=2", the output will be "?test=1me=2".

 This is not the case as by default "&" is a safe character for iriencode:
 https://github.com/django/django/blob/main/django/utils/encoding.py#L135.

 It is urlencode that does that conversion. iriencode is more for non-ascii
 characters in my understanding, and using both at the same time is
 supported:
 {{{
 value|urlencode|iriencode
 }}}
-- 
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/0107018e18cf8729-8e50d4e9-6f58-4ac1-9daf-d270ba485d42-00%40eu-central-1.amazonses.com.


Re: [Django] #35279: Memory Leak with `prefetch_related`

2024-03-07 Thread Django
#35279: Memory Leak with `prefetch_related`
-+-
 Reporter:  Ken Tong |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  memory leak  | 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:  Uncategorized => Database layer (models, ORM)
 * stage:  Unreviewed => Accepted
 * type:  Bug => Cleanup/optimization

Comment:

 Interesting, thanks for the report. Tentatively accepted for further
 investigation.
-- 
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/0107018e18b8a921-3c1c286d-dd90-4edd-94bc-58de8c329719-00%40eu-central-1.amazonses.com.


Re: [Django] #35279: Memory Leak with `prefetch_related`

2024-03-07 Thread Django
#35279: Memory Leak with `prefetch_related`
---+--
 Reporter:  Ken Tong   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Uncategorized  |  Version:  4.2
 Severity:  Normal |   Resolution:
 Keywords:  memory leak| Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Comment (by Ken Tong):

 Hi Team,

 So far I am adding the code below in the appropriate lines in order to fix
 the memory leak in my projects. Hopefully there will be a fix and
 documented way to properly clean up the cache.

 {{{
 foo._prefetched_objects_cache.pop("bar_set")
 }}}

 Thank you for your attention!
-- 
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/0107018e18641c84-3c729fb1-88db-45b0-a917-3e142a731ce5-00%40eu-central-1.amazonses.com.


[Django] #35279: Memory Leak with `prefetch_related`

2024-03-07 Thread Django
#35279: Memory Leak with `prefetch_related`
-+-
   Reporter:  canton |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Uncategorized  |Version:  4.2
   Severity:  Normal |   Keywords:  memory leak
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Memory Leak after calling `queryset.prefetch_related()` or
 `prefetch_related_objects()`

 To reproduce:

 {{{
 import gc
 from django.db import models
 from django.db.models import prefetch_related_objects


 class Foo(models.Model):
 id = models.AutoField(primary_key=True)


 class Bar(models.Model):
 id = models.AutoField(primary_key=True)
 foo = models.ForeignKey(Foo, on_delete=models.CASCADE)


 def prepare_data():
 if Foo.objects.exists():
 return
 foo = Foo()
 foo.save()
 bar = Bar(foo=foo)
 bar.save()


 def test1():
 # no prefetch
 for foo in Foo.objects.all():
 for bar in foo.bar_set.all():
 print(foo.id, bar.id)


 def test2():
 # queryset.prefetch_related()
 for foo in Foo.objects.prefetch_related("bar_set").all():
 for bar in foo.bar_set.all():
 print(foo.id, bar.id)


 def test3():
 # prefetch_related_objects()
 foo_list = list(Foo.objects.all())
 prefetch_related_objects(foo_list, "bar_set")
 for foo in foo_list:
 for bar in foo.bar_set.all():
 print(foo.id, bar.id)


 def run():
 prepare_data()

 # warn up
 test1()
 test2()
 test3()

 gc.collect()

 gc.set_debug(gc.DEBUG_LEAK)

 gc.collect()
 print(f"baseline - garbage count: {len(gc.garbage)}")

 test1()
 gc.collect()
 print(f"test1 - garbage count: {len(gc.garbage)}")

 test2()
 gc.collect()
 print(f"test2 - garbage count: {len(gc.garbage)}")

 test3()
 gc.collect()
 print(f"test3 - garbage count: {len(gc.garbage)}")

 gc.set_debug(0)


 run()
 }}}


 Output
 {{{
 1 1
 1 1
 1 1
 baseline - garbage count: 0
 1 1
 test1 - garbage count: 0  # no memory leak
 1 1
 test2 - garbage count: 23  # 23 objects leaked
 1 1
 test3 - garbage count: 46  # another 23 objects leaked
 }}}
-- 
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/0107018e18508607-55fd6223-5289-406d-a678-293bc8f21e1c-00%40eu-central-1.amazonses.com.


Re: [Django] #35030: Make django.contrib.auth decorators work with async functions.

2024-03-07 Thread Django
#35030: Make django.contrib.auth decorators work with async functions.
-+-
 Reporter:  Mike Lissner |Owner:  Dingning
 Type:  New feature  |   Status:  closed
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  async, decorator | 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:"549320946dfdaac6ccb6c0d3150c46db92637187" 5493209]:
 {{{#!CommitTicketReference repository=""
 revision="549320946dfdaac6ccb6c0d3150c46db92637187"
 Fixed #35030 -- Made django.contrib.auth decorators to work with async
 functions.
 }}}
-- 
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/0107018e184d3c49-3375ad4e-bddd-4b7e-9b26-a7e4baf3f49b-00%40eu-central-1.amazonses.com.


Re: [Django] #35030: Make django.contrib.auth decorators work with async functions.

2024-03-07 Thread Django
#35030: Make django.contrib.auth decorators work with async functions.
-+-
 Reporter:  Mike Lissner |Owner:  Dingning
 Type:  New feature  |   Status:  assigned
Component:  contrib.auth |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  async, decorator | 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/0107018e182281a7-7597081e-476a-4ba7-a04a-47f3f35355ca-00%40eu-central-1.amazonses.com.


Re: [Django] #35278: `ngettext` result can be possibly undefined.

2024-03-07 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
 Reporter:  Piotr Kawula |Owner:  Piotr
 |  Kawula
 Type:  Uncategorized|   Status:  assigned
Component:   |  Version:  5.0
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  ngettext,catalog,i18n,internationalization,|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Piotr Kawula:

Old description:

> When the translation engine provide an invalid plural rule the
> `pluralidx` function can return invalid index which will cause the
> `ngettext` to return value that does not exist - `undefined`.
> Same result can occur when the `newcatalog` contains invalid values, for
> example:
>
> {{{
> const newcatalog = {
>   '%s something': [],
>   ...
> }
> }}}
>
> And in `ngettext` we have:
> {{{
> django.ngettext = function(singular, plural, count) {
>  const value = django.catalog[singular];
>  if (typeof value === 'undefined') {
> return (count == 1) ? singular : plural;
>   } else {
> return value.constructor === Array ? value[django.pluralidx(count)] :
> value;
>   }
> };
> }}}
>
> Which in case of empty array go for `value[django.pluralidx(count)] `
> which is undefined.
>

> I think we want the `ngettext` function to return string always, if it
> does not find proper value in catalog, should default to the provided
> values.

New description:

 When the translation engine provide an invalid plural rule the `pluralidx`
 function can return invalid index which will cause the `ngettext` to
 return value that does not exist - `undefined`.
 Same result can occur when the `newcatalog` contains invalid values, for
 example:

 {{{
 const newcatalog = {
   '%s something': [],
   ...
 }
 }}}

 And in `ngettext` we have:
 {{{
 django.ngettext = function(singular, plural, count) {
  const value = django.catalog[singular];
  if (typeof value === 'undefined') {
 return (count == 1) ? singular : plural;
   } else {
 return value.constructor === Array ? value[django.pluralidx(count)] :
 value;
   }
 };
 }}}

 Which in case of empty array go for `value[django.pluralidx(count)] `
 which is undefined.


 I think we want the `ngettext` function to return string always, if it
 does not find proper value in catalog, should default to the provided
 values.

 It affects the previous versions too.

--
-- 
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/0107018e1803998b-fe4328be-a762-4c93-aaf9-d4b592921159-00%40eu-central-1.amazonses.com.


[Django] #35278: `ngettext` result can be possibly undefined.

2024-03-07 Thread Django
#35278: `ngettext` result can be possibly undefined.
-+-
   Reporter:  Piotr  |  Owner:  Piotr Kawula
  Kawula |
   Type: | Status:  assigned
  Uncategorized  |
  Component: |Version:  5.0
  Internationalization   |   Keywords:
   Severity:  Normal |  
ngettext,catalog,i18n,internationalization,
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 When the translation engine provide an invalid plural rule the `pluralidx`
 function can return invalid index which will cause the `ngettext` to
 return value that does not exist - `undefined`.
 Same result can occur when the `newcatalog` contains invalid values, for
 example:

 {{{
 const newcatalog = {
   '%s something': [],
   ...
 }
 }}}

 And in `ngettext` we have:
 {{{
 django.ngettext = function(singular, plural, count) {
  const value = django.catalog[singular];
  if (typeof value === 'undefined') {
 return (count == 1) ? singular : plural;
   } else {
 return value.constructor === Array ? value[django.pluralidx(count)] :
 value;
   }
 };
 }}}

 Which in case of empty array go for `value[django.pluralidx(count)] `
 which is undefined.


 I think we want the `ngettext` function to return string always, if it
 does not find proper value in catalog, should default to the provided
 values.
-- 
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/0107018e1802ac97-da9cedfb-9ea4-4e88-a746-ef903a324deb-00%40eu-central-1.amazonses.com.