Re: [Django] #34574: Extend docs for `autoescape` and `escape` with examples using filters that operate with sequences

2023-05-25 Thread Django
#34574: Extend docs for `autoescape` and `escape` with examples using filters 
that
operate with sequences
-+-
 Reporter:  Natalia Bidart   |Owner:  Natalia
 Type:   |  Bidart
  Cleanup/optimization   |   Status:  closed
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   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:"25bd9faf327c7c0a45b9ca6e0ea678d898af8838" 25bd9fa]:
 {{{
 #!CommitTicketReference repository=""
 revision="25bd9faf327c7c0a45b9ca6e0ea678d898af8838"
 [4.2.x] Fixed #34574 -- Noted unexpected outcomes in autoescape/escape
 docs.

 Backport of 1a59a324cec5caf12ea0c4947564828aa7bda02a 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/01070188569cba43-4c1842c2-7bdb-46ab-88ce-2cae6cfae194-00%40eu-central-1.amazonses.com.


Re: [Django] #34574: Extend docs for `autoescape` and `escape` with examples using filters that operate with sequences

2023-05-25 Thread Django
#34574: Extend docs for `autoescape` and `escape` with examples using filters 
that
operate with sequences
-+-
 Reporter:  Natalia Bidart   |Owner:  Natalia
 Type:   |  Bidart
  Cleanup/optimization   |   Status:  closed
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   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 ):

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


Comment:

 In [changeset:"1a59a324cec5caf12ea0c4947564828aa7bda02a" 1a59a32]:
 {{{
 #!CommitTicketReference repository=""
 revision="1a59a324cec5caf12ea0c4947564828aa7bda02a"
 Fixed #34574 -- Noted unexpected outcomes in autoescape/escape docs.
 }}}

-- 
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/01070188569af1ce-91d95e5b-c546-413b-ba35-c002023de958-00%40eu-central-1.amazonses.com.


Re: [Django] #34577: New template filter `escapeseq`

2023-05-25 Thread Django
#34577: New template filter `escapeseq`
-+-
 Reporter:  Natalia Bidart   |Owner:  Arthur
 |  Moreira
 Type:  New feature  |   Status:  closed
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"881cc139e2d53cc1d3ccea7f38faa960f9e56597" 881cc13]:
 {{{
 #!CommitTicketReference repository=""
 revision="881cc139e2d53cc1d3ccea7f38faa960f9e56597"
 Refs #34574, Refs #34577 -- Mentioned escapeseq filter in
 escape/autoescape docs.
 }}}

-- 
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/01070188569af1f1-6a182624-33b6-42f4-b8f8-dc16e85ce865-00%40eu-central-1.amazonses.com.


Re: [Django] #34574: Extend docs for `autoescape` and `escape` with examples using filters that operate with sequences

2023-05-25 Thread Django
#34574: Extend docs for `autoescape` and `escape` with examples using filters 
that
operate with sequences
-+-
 Reporter:  Natalia Bidart   |Owner:  Natalia
 Type:   |  Bidart
  Cleanup/optimization   |   Status:  closed
Component:  Template system  |  Version:  4.2
 Severity:  Normal   |   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:"881cc139e2d53cc1d3ccea7f38faa960f9e56597" 881cc13]:
 {{{
 #!CommitTicketReference repository=""
 revision="881cc139e2d53cc1d3ccea7f38faa960f9e56597"
 Refs #34574, Refs #34577 -- Mentioned escapeseq filter in
 escape/autoescape docs.
 }}}

-- 
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/01070188569af214-569d6e56-79dc-4039-8aaf-758781a5c38e-00%40eu-central-1.amazonses.com.


Re: [Django] #34574: Extend docs for `autoescape` and `escape` with examples using filters that operate with sequences

2023-05-25 Thread Django
#34574: Extend docs for `autoescape` and `escape` with examples using filters 
that
operate with sequences
-+-
 Reporter:  Natalia Bidart   |Owner:  Natalia
 Type:   |  Bidart
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  4.2
 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/010701885650323d-0fe9f34b-8bb1-43f6-b55f-71b6d1e9b0eb-00%40eu-central-1.amazonses.com.


Re: [Django] #34598: Load new settings after start up

2023-05-25 Thread Django
#34598: Load new settings after start up
---+--
 Reporter:  boomdizz   |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Uncategorized  |  Version:  4.2
 Severity:  Normal |   Resolution:  invalid
 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:   => invalid


Comment:

 Please don't use Trac as a support channel. Closing per
 TicketClosingReasons/UseSupportChannels.

-- 
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/01070188563b4537-8332691e-10fa-431f-a6fa-367d059ff321-00%40eu-central-1.amazonses.com.


[Django] #34598: Load new settings after start up

2023-05-25 Thread Django
#34598: Load new settings after start up
-+
   Reporter:  boomdizz   |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Uncategorized  |Version:  4.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  |
-+
 We have a usecase where our web application is
 (a) running on Django using local users (which is standard),
 (b) is then modified by our UI to take in an LDAP configuration to support
 directory services remote users
 LDAP setup is managed by the django-auth-ldap module, but it's
 configuration ends up in settings.py. How can we get Django to
 automatically pick up these changes without restarting?
 Or, is there another way to support such a usecase. In more general terms,
 how can Django be told to reload it's configuration?

-- 
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/010701885567f369-a5d22254-14c1-4e46-a58d-0df77b5d03c1-00%40eu-central-1.amazonses.com.


Re: [Django] #34535: dbshell management command can crash if DATABASES["name"] is a PosixPath

2023-05-25 Thread Django
#34535: dbshell management command can crash if DATABASES["name"] is a PosixPath
-+-
 Reporter:  Jan Pieter   |Owner:  Jan
  Waagmeester|  Pieter Waagmeester
 Type:  Bug  |   Status:  closed
Component:  Core (Management |  Version:  4.2
  commands)  |
 Severity:  Normal   |   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 Adam Johnson):

 I also just hit this. Thanks for the fix.

 For completeness, the "sometimes" depends on the exit code of SQLite,
 which is non-zero if the last run query was an error, for example:

 {{{
 $ ./manage.py dbshell
 SQLite version 3.39.5 2022-10-14 20:58:05
 Enter ".help" for usage hints.
 sqlite> select;
 Parse error: near ";": syntax error
   select;
 ^--- error here
 sqlite> ^D
 Traceback (most recent call last):
 ...
 TypeError: sequence item 1: expected str instance, PosixPath found
 }}}

-- 
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/010701885484f547-9036fa9c-c071-4165-9371-a12e96f3a313-00%40eu-central-1.amazonses.com.


Re: [Django] #34597: Django ORM query SQL generation changed (and is apparently a lot slower)

2023-05-25 Thread Django
#34597: Django ORM query SQL generation changed (and is apparently a lot slower)
-+-
 Reporter:  Lorand Varga |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  3.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  needsinfo
 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 Simon Charette):

 * status:  new => closed
 * severity:  Release blocker => Normal
 * cc: Simon Charette (added)
 * type:  Bug => Cleanup/optimization
 * version:  4.2 => 3.2
 * resolution:   => needsinfo


Comment:

 More likely to be related to #32143
 (8593e162c9cb63a6c0b06daf045bc1c21eb4d7c1) which switched to using
 `EXISTS` over `NOT IN` and was already part of Django 3.2.

 AFAIK this is the only report in three years about this change making
 things slower and the fact it jumped from a couple of seconds to hours
 makes me think there might be something else at play here (lack of
 analyze?). FWIW this change was advised [https://www.percona.com/blog/sql-
 optimizations-in-postgresql-in-vs-exists-vs-any-all-vs-join/ by this
 article] and examples in the wild of `NOT IN` performing poorly.

 Without more details such as the Postgres execution plans (use `EXPLAIN`
 on the query) it's very hard to provide any guidance here so I'll close as
 ''needsinfo'' for now as I cannot reproduce any form of slowdown with the
 provided model. The `AND "blog"."id" = "blog"."id"` part seems definitely
 fishy though so it'd be great to see if you get fast results without it as
 that appear to be a bug.

 In the mean time you can use
 `~Q(id__in=Blog.objects.filter(translation=None, id=OuterRef("id")))`
 instead of `~Q(translation=None)`.

-- 
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/0107018853e4646b-54496b3e-4852-4d0e-8bc8-92ee048ac4e2-00%40eu-central-1.amazonses.com.


[Django] #34597: Django ORM query SQL generation changed (and is apparently a lot slower)

2023-05-25 Thread Django
#34597: Django ORM query SQL generation changed (and is apparently a lot slower)
-+-
   Reporter:  Lorand |  Owner:  nobody
  Varga  |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  4.2
  layer (models, ORM)|
   Severity:  Release|   Keywords:
  blocker|
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 My app has 2 models (making things simple so debugging is easier):
 {{{
 class Blog(models.Model):
   title = models.CharField(max_length=60, blank=True)
   is_published = models.BooleanField(default=generate_random_bool,
 db_index=True)

 class Translation(models.Model):
   blog = models.ForeignKey('Blog', on_delete=models.CASCADE,
 related_name='translation')
 }}}

 There is a reverse foreign key relation between translation and Blog. Also
 a blog can have multiple translations (or none).

 I have this code block:
 {{{
 from django.db.models import Q
 qs = Blog.objects.filter(Q(is_published=True) & ~Q(translation=None))
 print(qs.query)
 }}}

 django 2.2 ORM generates this output:
 {{{
 SELECT
   "blog"."id",
   "blog"."title",
   "blog"."is_published"
 FROM
   "blog"
 WHERE
   (
 "blog"."is_published" = True
 AND NOT (
   "blog"."id" IN (
 SELECT
   U0."id"
 FROM
   "blog" U0
   LEFT OUTER JOIN "translation" U1 ON (U0."id" = U1."blog_id")
 WHERE
   (
 U1."id" IS NULL
 AND U0."id" = ("blog"."id")
   )
   )
 )
   )
 }}}

 For the same code block the django 3.2+ ORM (tried also the latest version
 of django 4.2.1) it generates:
 {{{
 SELECT
   "blog"."id",
   "blog"."title",
   "blog"."is_published"
 FROM
   "blog"
 WHERE
   (
 "blog"."is_published"
 AND NOT (
   EXISTS(
 SELECT
   (1) AS "a"
 FROM
   "blog" U0
   LEFT OUTER JOIN "translation" U1 ON (U0."id" = U1."blog_id")
 WHERE
   (
 U1."id" IS NULL
 AND U0."id" = "blog"."id"
 AND "blog"."id" = "blog"."id"
   )
 LIMIT
   1
   )
 )
   )
 }}}
 which is a whole lot slower (at least on the same postgresql 13.7
 instance).
 The django 2.2 version executes in a couple of seconds while the newer
 version executes in half an hour.

 I think (but am not completely sure, might be terribly wrong) that the
 issue was introduced here:
 https://github.com/django/django/pull/13300/files

 Environment:
 asgiref==3.7.1
 backports.zoneinfo==0.2.1
 Django==3.2.19
 model-bakery==1.11.0
 psycopg2-binary==2.8.6
 pytz==2023.3
 sqlparse==0.4.4
 typing_extensions==4.6.1

 Db environment:
 PostgreSQL 13.7 on aarch64-unknown-linux-gnu, compiled by gcc (GCC) 7.3.1
 20180712 (Red Hat 7.3.1-6), 64-bit

 Bug does not manifest in django 2.2.12.
 Bug manifests in django 3.2 and django 4.2.

-- 
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/01070188537179c3-15612b98-395c-4d46-814a-db7b517e619c-00%40eu-central-1.amazonses.com.


Re: [Django] #34595: format_html() should explicitly mention that format_string is not escaped and that result is safe (was: format_html() should explicitely mention format_string is not escaped and t

2023-05-25 Thread Django
#34595: format_html() should explicitly mention that format_string is not 
escaped
and that result is safe
--+
 Reporter:  Natalia Bidart|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Template system   |  Version:  4.2
 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
--+

-- 
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/01070188531c93b7-407d3391-895f-40dc-8498-47551f213b8a-00%40eu-central-1.amazonses.com.


Re: [Django] #27925: Document how to deploy using pip installed mod_wsgi

2023-05-25 Thread Django
#27925: Document how to deploy using pip installed mod_wsgi
--+
 Reporter:  Vincent Lefoulon  |Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  1.10
 Severity:  Normal|   Resolution:
 Keywords:  mod_wsgi, apache  | 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:  Kshitij Raghav => (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/0107018852b65ac6-63631a89-415a-4fc5-bb4d-cce9e175541a-00%40eu-central-1.amazonses.com.


Re: [Django] #33414: Diamond inheritance causes duplicated PK error when creating an object, if the primary key field has a default.

2023-05-25 Thread Django
#33414: Diamond inheritance causes duplicated PK error when creating an object, 
if
the primary key field has a default.
-+-
 Reporter:  Yu Li|Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.0
  (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):

 * owner:  Yu Li => (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/0107018852b52f0e-0595b904-04b4-47d3-bd03-d29d34d6c86e-00%40eu-central-1.amazonses.com.


Re: [Django] #21080: collectstatic post-processing fails for references inside comments

2023-05-25 Thread Django
#21080: collectstatic post-processing fails for references inside comments
-+
 Reporter:  shreyas@…|Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  contrib.staticfiles  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Changes (by Mariusz Felisiak):

 * owner:  Tomáš Zigo => (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/01070188525cb28b-022b1def-c845-47f5-873a-58745ec9c2ce-00%40eu-central-1.amazonses.com.


Re: [Django] #34596: subclassing models.TextChoices

2023-05-25 Thread Django
#34596: subclassing models.TextChoices
---+--
 Reporter:  piscvau|Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Documentation  |  Version:  4.2
 Severity:  Normal |   Resolution:  invalid
 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:   => invalid


Comment:

 Thanks for this ticket, however we cannot document everything, that's why
 there are support channels and sites like StackOverflow. Subclassing
 `TextChoices` is not officially forbidden or supported, sky's the limit.
 Personally, I wouldn't hesitate to do so if you have a valid use case.

-- 
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/0107018851f69fd5-ef8f9233-7acf-4aff-9919-19c39f7f2c81-00%40eu-central-1.amazonses.com.


Re: [Django] #9519: Add QuerySet.bulk_delete() that issues only a single SQL query

2023-05-25 Thread Django
#9519: Add QuerySet.bulk_delete() that issues only a single SQL query
-+-
 Reporter:  Joey Wilhelm |Owner:  Akash
 |  Kumar Sen
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  database, queryset,  | Triage Stage:  Accepted
  delete |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Akash Kumar Sen):

 Replying to [comment:33 Mariusz Felisiak]:
 > Have you checked all comments and how it actually works? `delete()`
 collects objects PKs (direct and related), deletes, sends signals, etc.
 This issue is about adding `bulk_delete()` method which will bypass all
 these steps and perform `DELETE` based on the queryset filters.

 I tried to compare the number of queries with the analogy of
 {{{bulk_create}}} . But now the need seems reasonable, will try to create
 a patch with the following tasks performed.

 1. Introduce a new method called bulk_delete() in the QuerySet API.
 2. The bulk_delete() method should operate on the queryset and issue a
 single SQL query for deletion.
 3. The deletion should respect the previous query operations performed on
 the queryset(or take them as kwargs) such as filters and extra conditions.
 4. To optimize performance, the bulk_delete() method can take advantage of
 a "fast-path" deletion, similar to the existing delete operation and
 should not send any signals to avoid unnecessary overhead.
 5. If cascading deletes are needed, the bulk_delete() method should handle
 them by fetching only the necessary values from the database, without
 instantiating full objects.

-- 
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/0107018851f6064d-d8231944-4c1d-4472-8607-520612846ddf-00%40eu-central-1.amazonses.com.


[Django] #34596: subclassing models.TextChoices

2023-05-25 Thread Django
#34596: subclassing models.TextChoices
-+
   Reporter:  piscvau|  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Documentation  |Version:  4.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  |
-+
 Would it be possible to clarify in the documentation whether it is
 possible or not to subclass one of the  enums.Choices classes.
 The purpose would be for example to add a third attribute to the class.
 Here the question was raised one year and a half ago and no response is
 yet available.
 https://stackoverflow.com/questions/69091496/best-way-to-add-third-
 attribute-to-django-models-choices
 If it is possible, a hint on how to do it would be helpful (rewrite a
 __new__).
 If it is not possible may be a hint on the best way would be
 helpful(define a custom field?)

-- 
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/0107018851d6e581-1416b6a8-89ef-4018-a3d8-0ebb4f5128c2-00%40eu-central-1.amazonses.com.


Re: [Django] #34534: Reduce index/constraints operations.

2023-05-25 Thread Django
#34534: Reduce index/constraints operations.
--+
 Reporter:  David Sanders |Owner:  (none)
 Type:  Cleanup/optimization  |   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 Mariusz Felisiak):

 * owner:  Akash Kumar Sen => (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/0107018851c55249-9d330906-848d-4220-8f25-a2614c24c9a5-00%40eu-central-1.amazonses.com.