Re: [Django] #33656: crash when putting tuples as input for param of "default" in all range fields (psycopg2)

2022-04-21 Thread Django
#33656: crash when putting tuples as input for param of "default" in all range
fields (psycopg2)
-+-
 Reporter:  Li Yun   |Owner:  Li Yun
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  3.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  RangeWidget,psycopg2   |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Li Yun):

 * has_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/01070180500f4990-0a838188-a79f-4414-9818-a06aeb22d4c0-00%40eu-central-1.amazonses.com.


Re: [Django] #33656: crash when putting tuples as input for param of "default" in all range fields (psycopg2) (was: crash when putting tuples as input for param of "default" in range fields (psycopg2)

2022-04-21 Thread Django
#33656: crash when putting tuples as input for param of "default" in all range
fields (psycopg2)
-+-
 Reporter:  Li Yun   |Owner:  Li Yun
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  3.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  RangeWidget,psycopg2   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Li Yun):

 * owner:  nobody => Li Yun


-- 
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/010701804ffd11cf-28570655-eeac-4aa8-aa9c-5b553d303876-00%40eu-central-1.amazonses.com.


[Django] #33656: crash when putting tuples as input for param of "default" in range fields (psycopg2)

2022-04-21 Thread Django
#33656: crash when putting tuples as input for param of "default" in range 
fields
(psycopg2)
-+-
   Reporter:  Li Yun |  Owner:  nobody
   Type:  Bug| Status:  assigned
  Component:  Database   |Version:  3.2
  layer (models, ORM)|   Keywords:
   Severity:  Normal |  RangeWidget,psycopg2
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  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/010701804ff4a5c2-1ff2378e-831f-4dec-86dd-24a2981295c1-00%40eu-central-1.amazonses.com.


Re: [Django] #28592: Reorganize CSRF documentation and add to FAQs

2022-04-21 Thread Django
#28592: Reorganize CSRF documentation and add to FAQs
-+-
 Reporter:  Daniele Procida  |Owner:  Tomas
 Type:   |  McNamer
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  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:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Tomas, Do you have time to keep working on this?

-- 
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/010701804fbbef13-caec68c0-83bb-43fd-8822-64fd022afea5-00%40eu-central-1.amazonses.com.


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

2022-04-21 Thread Django
#33199: Deprecate passing positional arguments to Signer.
+
 Reporter:  Daniel Samuels  |Owner:  (none)
 Type:  New feature |   Status:  new
Component:  Core (Other)|  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:  Nikita Marchant => (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/010701804f8cc3d5-12da724c-f359-4f00-8012-96f5166b9672-00%40eu-central-1.amazonses.com.


Re: [Django] #27674: Deprecate GeoModelAdmin and OSMGeoAdmin

2022-04-21 Thread Django
#27674: Deprecate GeoModelAdmin and OSMGeoAdmin
-+-
 Reporter:  Claude Paroz |Owner:  Mariusz
 Type:   |  Felisiak
  Cleanup/optimization   |   Status:  assigned
Component:  GIS  |  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 Mariusz Felisiak):

 * owner:  (none) => Mariusz Felisiak
 * status:  new => assigned
 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/15624 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/010701804f86eeba-53100d1c-2376-44f4-a0d2-fdfed9f134fd-00%40eu-central-1.amazonses.com.


Re: [Django] #33655: Unnecessary column in a GROUP BY clause with QuerySet.exists()

2022-04-21 Thread Django
#33655: Unnecessary column in a GROUP BY clause with QuerySet.exists()
-+-
 Reporter:  Marc Perrin  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  exists group by  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 > provided the value of said column does not affect the exists() return
 value - for example if it's 0?

 No, it's not. It's enough for the query to return any rows.

-- 
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/010701804f70739e-0de8823c-f7de-4b8e-b98d-aee4a7963507-00%40eu-central-1.amazonses.com.


Re: [Django] #33509: Add SQL comment to describe deliberately no-op migration operations

2022-04-21 Thread Django
#33509: Add SQL comment to describe deliberately no-op migration operations
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  closed
Component:  Migrations   |  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:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

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


Comment:

 In [changeset:"6f453cd2981525b33925faaadc7a6e51fa90df5c" 6f453cd2]:
 {{{
 #!CommitTicketReference repository=""
 revision="6f453cd2981525b33925faaadc7a6e51fa90df5c"
 Fixed #33509 -- Added "(no-op)" to sqlmigrate output for operations
 without SQL statement.
 }}}

-- 
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/010701804c4c3483-bd24ba54-57e9-4588-ae35-f211e0222e6a-00%40eu-central-1.amazonses.com.


Re: [Django] #33509: Add SQL comment to describe deliberately no-op migration operations

2022-04-21 Thread Django
#33509: Add SQL comment to describe deliberately no-op migration operations
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Migrations   |  Version:  dev
 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
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"f15f7d395c99e3c1194c37eaa4f5958392c1ee07" f15f7d39]:
 {{{
 #!CommitTicketReference repository=""
 revision="f15f7d395c99e3c1194c37eaa4f5958392c1ee07"
 Refs #33509 -- Made sqlmigrate tests stricter and improved isolation.
 }}}

-- 
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/010701804c4c3413-60d590f3-585e-4daf-90a5-85eba28bd51f-00%40eu-central-1.amazonses.com.


Re: [Django] #33655: Unnecessary column in a GROUP BY clause with QuerySet.exists()

2022-04-21 Thread Django
#33655: Unnecessary column in a GROUP BY clause with QuerySet.exists()
-+-
 Reporter:  Marc Perrin  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  exists group by  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Marc Perrin):

 Thanks for the quick answer.

 Your suggested workaround seems interesting indeed (provided the value of
 said column does not affect the exists() return value - for example if
 it's 0?)

 NB: I didn't mean removing all constants from GROUP BY, rather: removing
 the automatic transmission of constants from the SELECT clause to the
 GROUP BY clause, since their meaning automatically switches from "constant
 number n" to "nth element of the select clause" which imo can never be
 intended.

-- 
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/010701804c403f45-02daa392-4483-4b5a-8d7e-b240e4d38324-00%40eu-central-1.amazonses.com.


Re: [Django] #33509: Add SQL comment to describe deliberately no-op migration operations

2022-04-21 Thread Django
#33509: Add SQL comment to describe deliberately no-op migration operations
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Migrations   |  Version:  dev
 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/010701804baa17eb-c670f843-e2ef-4cf1-a934-77aeebf6f894-00%40eu-central-1.amazonses.com.


Re: [Django] #33308: Add psycopg3 backend

2022-04-21 Thread Django
#33308: Add psycopg3 backend
-+-
 Reporter:  Paolo Melchiorre |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  database postgresql  | Triage Stage:  Accepted
  backend orm|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Andreas Rammhold):

 * cc: Andreas Rammhold (added)


-- 
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/010701804b9740df-33d4ef80-72bb-4f22-800e-42285e272e3d-00%40eu-central-1.amazonses.com.


Re: [Django] #33004: Inconsistent / Unexpected handling of assigning unsaved model to Generic Foreign Key

2022-04-21 Thread Django
#33004: Inconsistent / Unexpected handling of assigning unsaved model to Generic
Foreign Key
-+-
 Reporter:  Finn Andersen|Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  fk, gfk, generic | Triage Stage:  Ready for
  foreign key, validation|  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:"cd4da34fc1f1df08f593e461b2f670bfd61d0d2f" cd4da34f]:
 {{{
 #!CommitTicketReference repository=""
 revision="cd4da34fc1f1df08f593e461b2f670bfd61d0d2f"
 Fixed #33004 -- Made saving objects with unsaved GenericForeignKey raise
 ValueError.

 This aligns to the behaviour of OneToOneField and ForeignKey fields.

 Thanks Jonny Park for the initial 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/010701804b861b33-cac679b4-1366-40d5-ba5b-d0c6e274e62c-00%40eu-central-1.amazonses.com.


Re: [Django] #33509: Add SQL comment to describe deliberately no-op migration operations

2022-04-21 Thread Django
#33509: Add SQL comment to describe deliberately no-op migration operations
-+-
 Reporter:  Adam Johnson |Owner:  Adam
 Type:   |  Johnson
  Cleanup/optimization   |   Status:  assigned
Component:  Migrations   |  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 Adam Johnson):

 * needs_better_patch:  1 => 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/010701804b523966-8178060d-582c-4e1a-95a1-968acab36dc1-00%40eu-central-1.amazonses.com.


Re: [Django] #33507: Use native UUID data type on MariaDB 10.7+

2022-04-21 Thread Django
#33507: Use native UUID data type on MariaDB 10.7+
-+-
 Reporter:  Mariusz Felisiak |Owner:  raydeal
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  4.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  mariadb  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by raydeal):

 * owner:  nobody => raydeal
 * 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/010701804b4ed5ff-458760ca-7c13-4e91-b322-10bdd107fcb4-00%40eu-central-1.amazonses.com.


Re: [Django] #32577: Add support for `UUIDAutoField` `DEFAULT_AUTO_FIELD`

2022-04-21 Thread Django
#32577: Add support for `UUIDAutoField` `DEFAULT_AUTO_FIELD`
-+-
 Reporter:  Tomasz Wójcik|Owner:  raydeal
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  3.2
  (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 raydeal):

 * owner:  nobody => raydeal
 * 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/010701804b3fd3be-78269d2e-ed75-42f6-8844-02d759175ba2-00%40eu-central-1.amazonses.com.


Re: [Django] #17337: [nonrel] Support for non-integer AutoFields

2022-04-21 Thread Django
#17337: [nonrel] Support for non-integer AutoFields
-+-
 Reporter:  Jonas H. |Owner:  raydeal
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  nonrel   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by raydeal):

 * owner:  nobody => raydeal
 * 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/010701804b3e9673-0fcefdb4-9a0b-46e0-80b7-fd34e3984514-00%40eu-central-1.amazonses.com.


Re: [Django] #33004: Inconsistent / Unexpected handling of assigning unsaved model to Generic Foreign Key

2022-04-21 Thread Django
#33004: Inconsistent / Unexpected handling of assigning unsaved model to Generic
Foreign Key
-+-
 Reporter:  Finn Andersen|Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  fk, gfk, generic | Triage Stage:  Ready for
  foreign key, validation|  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/010701804b30b0bb-6c99fe0b-61eb-4b9f-9581-dcf4f529b359-00%40eu-central-1.amazonses.com.


Re: [Django] #13085: GenericForeignKey.get_content_type fails if `object` or `id` evaluate to False. Should use 'is not None' test.

2022-04-21 Thread Django
#13085: GenericForeignKey.get_content_type fails if `object` or `id` evaluate to
False.  Should use 'is not None' test.
-+-
 Reporter:  Ben  |Owner:  Ramiro
 |  Morales 
 Type:  Bug  |   Status:  closed
Component:   |  Version:  dev
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:  fixed
 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 GitHub ):

 In [changeset:"1ed8ca43f61138b8f8d6f92106c27060753ed4e7" 1ed8ca43]:
 {{{
 #!CommitTicketReference repository=""
 revision="1ed8ca43f61138b8f8d6f92106c27060753ed4e7"
 Refs #13085 -- Removed unnecessary ManyToManyFields from
 generic_relations_regress test models.
 }}}

-- 
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/010701804b224829-4351d6eb-2826-4c6b-b36d-19b295511c3e-00%40eu-central-1.amazonses.com.


Re: [Django] #33655: Unnecessary column in a GROUP BY clause with QuerySet.exists() (was: Interaction between exists() and group by)

2022-04-21 Thread Django
#33655: Unnecessary column in a GROUP BY clause with QuerySet.exists()
-+-
 Reporter:  Marc Perrin  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  4.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  exists group by  | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * cc: Simon Charette (added)
 * type:  Uncategorized => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the report. I agree that `(1)` is unnecessary in the `GROUP BY`
 clause unfortunately we cannot always remove constants from it because
 folks can use them as an alias for n-th column (as you already noticed).
 Maybe we could select only the first column from the `GROUP BY` clause
 instead:
 {{{#!diff
 diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
 index 64e7927f7a..940d3141d1 100644
 --- a/django/db/models/sql/query.py
 +++ b/django/db/models/sql/query.py
 @@ -582,8 +582,11 @@ class Query(BaseExpression):
  q.clear_ordering(force=True)
  if limit:
  q.set_limits(high=1)
 -q.add_extra({"a": 1}, None, None, None, None, None)
 -q.set_extra_mask(["a"])
 +if q.group_by and not q.select:
 +q.add_select_col(q.group_by[0], "a")
 +else:
 +q.add_extra({"a": 1}, None , None, None, None, None)
 +q.set_extra_mask(["a"])
  return q

  def has_results(self, using):
 }}}
 Tentatively accepted for future 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/010701804aec58f5-ab4ac646-e561-4385-9505-48229bf38243-00%40eu-central-1.amazonses.com.