Re: [Django] #34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN are database-dependent.

2023-01-16 Thread Django
#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are database-dependent.
-+-
 Reporter:  Matt Cooper  |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  floatfield   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Carlton Gibson):

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


Comment:

 So we have:

 > This is not obvious, and much like the "empty string vs null" discussion
 in CharField

 vs:

 > As for me it's a database caveat, and we cannot document all caveats in
 Django docs.

 I think I agree with the latter here.

 The `CharField` `blank`/`null` issue is something that's going to hit
 every user, pretty much immediately as they start using Django. It's worth
 documenting, and it even merits a whole `kwarg` and special handling in
 the field.

 In contrast (I think) storing `inf` and `NaN` are more specialised and
 advanced use cases. I look at
 [https://github.com/django/django/pull/16461/files#diff-
 fc688171203d4ce1e42c46f25bddfee5f494b0b1b81258907ff0531c81f2a4aeR1110-R1114
 the diff in the PR] and think that it's just not relevant to the vast
 majority of users. I think the particular SQLite callout is misplaced
 there. **Most though** I expect folks storing these values (as more
 specialised and advanced) to be writing tests checking the round-trip
 behaviour, in a way that we can't expect of the beginner hitting the
 `blank`/`null` issue with CharField.

 Floats are troublesome (granted). Maybe there's a cases for an addition to
 the [https://docs.djangoproject.com/en/4.1/ref/databases/#databases
 Databases doc] with the issue explained for each DB. With the proposed PR,
 what conclusion am I to take if I'm on PostgreSQL, or …? — write some
 tests and see?

 Happy to review such if you wanted to take it on Matt. Pending such, I
 think it's a `wontfix`.

-- 
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/01070185beb921ae-a2b72046-14d4-4ef4-b112-7b337a1a10c9-00%40eu-central-1.amazonses.com.


Re: [Django] #34262: Queryset grouped by annotation with aggregates on another annotated expression crashes on MySQL with sql_mode=only_full_group_by.

2023-01-16 Thread Django
#34262: Queryset grouped by annotation with aggregates on another annotated
expression crashes on MySQL with sql_mode=only_full_group_by.
-+-
 Reporter:  Mariusz Felisiak |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  mysql| Triage Stage:  Accepted
  only_full_group_by |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Unreviewed => Accepted


-- 
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/01070185bea07c1e-500b88dd-854a-4ec1-bf8c-64053f7c1faa-00%40eu-central-1.amazonses.com.


Re: [Django] #34255: Annotation/group by with an expression on psycopg3

2023-01-16 Thread Django
#34255: Annotation/group by with an expression on psycopg3
-+-
 Reporter:  Guillaume Andreu |Owner:  Mariusz
  Sabater|  Felisiak
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  orm postgres | Triage Stage:  Accepted
  psycopg3 annotation groupby|
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:"c8a76059ff6ff37fb51972fe2ba8b9d9464af769" c8a7605]:
 {{{
 #!CommitTicketReference repository=""
 revision="c8a76059ff6ff37fb51972fe2ba8b9d9464af769"
 Refs #34255 -- Bumped required psycopg version to 3.1.8.
 }}}

-- 
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/01070185be9d7614-00e02653-3ac8-4ef5-a77c-be6012bd6929-00%40eu-central-1.amazonses.com.


Re: [Django] #34255: Annotation/group by with an expression on psycopg3

2023-01-16 Thread Django
#34255: Annotation/group by with an expression on psycopg3
-+-
 Reporter:  Guillaume Andreu |Owner:  Mariusz
  Sabater|  Felisiak
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  orm postgres | Triage Stage:  Accepted
  psycopg3 annotation groupby|
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:"0e2649fdf40cedc5be7e2c0e5f7711f315e36b84" 0e2649fd]:
 {{{
 #!CommitTicketReference repository=""
 revision="0e2649fdf40cedc5be7e2c0e5f7711f315e36b84"
 Fixed #34255 -- Made PostgreSQL backend use client-side parameters binding
 with psycopg version 3.

 Thanks Guillaume Andreu Sabater for the report.

 Co-authored-by: Florian Apolloner 
 }}}

-- 
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/01070185be9d7649-17abfc9b-a24d-4a8f-ac9b-2ccd49036ea2-00%40eu-central-1.amazonses.com.


Re: [Django] #34242: Behavior of Model.delete() with regards to primary_key fields is not documented

2023-01-16 Thread Django
#34242: Behavior of Model.delete() with regards to primary_key fields is not
documented
--+
 Reporter:  SwampFalc |Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  dev
 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 Ashir Rashid):

 * owner:  Ashir Rashid => (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/01070185be6a4a8f-fbead9ce-1d16-46a2-83e0-b78ee2f4c2cf-00%40eu-central-1.amazonses.com.


Re: [Django] #34254: Exists annotations can return non-boolean results (i.e. None) if used with an empty QuerySet.

2023-01-16 Thread Django
#34254: Exists annotations can return non-boolean results (i.e. None) if used 
with
an empty QuerySet.
-+-
 Reporter:  Keryn Knight |Owner:
 |  rajdesai24
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  Exists   | Triage Stage:  Accepted
  EmptyQuerySet sqlite postgres  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 Thanks for confirming Keryn, the difference in query generation is
 effectively expected on depending on whether the backend has a native
 boolean type.

 -

 rajdesai24, sure thing please go ahead and submit a PR. Make sure to
 include a regression test demonstrating the problem that fails without the
 patch applied and passes with it applied.

 I suggested adding one in `tests/annotations/tests.py` similarly to
 
[https://github.com/django/django/commit/dd1fa3a31b4680c0d3712e6ae122b878138580c7
 #diff-
 1dc2d9f6410d5dbede47f9ea73f97bb4942f00ffddffccf0857919835149cbd8R213-R218
 the one] added in dd1fa3a31b4680c0d3712e6ae122b878138580c7 but using
 `Exists` instead of `Subquery`.

-- 
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/01070185be232abc-de29e836-7005-476d-9707-5b5c92801d35-00%40eu-central-1.amazonses.com.


Re: [Django] #34262: Queryset grouped by annotation with aggregates on another annotated expression crashes on MySQL with sql_mode=only_full_group_by.

2023-01-16 Thread Django
#34262: Queryset grouped by annotation with aggregates on another annotated
expression crashes on MySQL with sql_mode=only_full_group_by.
-+-
 Reporter:  Mariusz Felisiak |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  mysql| Triage Stage:
  only_full_group_by |  Unreviewed
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)


-- 
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/01070185be198419-ec881e90-0944-4d3b-a782-d81eaa51b3db-00%40eu-central-1.amazonses.com.


Re: [Django] #34263: File validators for MIME type, size, and extension. (was: file validator)

2023-01-16 Thread Django
#34263: File validators for MIME type, size, and extension.
-+-
 Reporter:  Reza Shakeri |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  File |  Version:  4.1
  uploads/storage|
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  file, file   | Triage Stage:
  validator, file validation,|  Unreviewed
  validator, file|
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:   => wontfix


Comment:

 Thanks for this ticket, however I think it is a good candidate for a
 third-party package. The current thread is to keep Django a core
 framework, not providing every validator which might be useful. Please
 write to the DevelopersMailingList if you want other opinions, 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/01070185be0a4f1f-589db97c-78c6-4a47-96c6-fc03aa4c1805-00%40eu-central-1.amazonses.com.


Re: [Django] #34263: file validator

2023-01-16 Thread Django
#34263: file validator
-+-
 Reporter:  Reza Shakeri |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  4.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  file, file   | Triage Stage:
  validator, file validation,|  Unreviewed
  validator, file|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Reza Shakeri:

Old description:

> Hi, I wrote a file validator that can validation the files based on their
> MIME and their size and extension, and all of these sections are
> implemented using their Django own features. I wanted to see I could add
> this feature to Django and give Pull Request.

New description:

 Hi, I wrote a file validator that can validation the files based on their
 MIME and their size and extension, and all of these sections are
 implemented using their Django own features. I wanted to see I could add
 this feature to Django and give Pull Request.
 If you want to upload the code I wrote for this file validator to check
 out 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/01070185bc62d518-f2e71ba0-2e10-4b1c-bfc0-52935aa72813-00%40eu-central-1.amazonses.com.


Re: [Django] #34263: file validator

2023-01-16 Thread Django
#34263: file validator
-+-
 Reporter:  Reza Shakeri |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  4.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  file, file   | Triage Stage:
  validator, file validation,|  Unreviewed
  validator, file|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Reza Shakeri:

Old description:

> Hi, I wrote a file validator that can validation the files based on their
> MIME and their size and extension, and all of these sections are
> implemented using their Django own features. I wanted to see I could add
> this feature to Django and give Pull Request

New description:

 Hi, I wrote a file validator that can validation the files based on their
 MIME and their size and extension, and all of these sections are
 implemented using their Django own features. I wanted to see I could add
 this feature to Django and give Pull Request.

--

-- 
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/01070185bc60cd9c-b6dcb441-a214-43d7--d27eeaa4fa26-00%40eu-central-1.amazonses.com.


Re: [Django] #34263: file validator

2023-01-16 Thread Django
#34263: file validator
-+-
 Reporter:  Reza Shakeri |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  4.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  file, file   | Triage Stage:
  validator, file validation,|  Unreviewed
  validator, file|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Reza Shakeri:

Old description:

> Hi, I wrote a file validator that can validation the files based on their
> MIME and their size and extension, and all of these sections are
> implemented using their Django own features. I wanted to see I could add
> this feature to Django and give Pull Request
> If you want to upload the sample code to check.

New description:

 Hi, I wrote a file validator that can validation the files based on their
 MIME and their size and extension, and all of these sections are
 implemented using their Django own features. I wanted to see I could add
 this feature to Django and give Pull Request

--

-- 
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/01070185bc6071bb-ef11bdcb-969d-41ad-84da-3430a85eed66-00%40eu-central-1.amazonses.com.


Re: [Django] #34263: file validator

2023-01-16 Thread Django
#34263: file validator
-+-
 Reporter:  Reza Shakeri |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  File |  Version:  4.1
  uploads/storage|
 Severity:  Normal   |   Resolution:
 Keywords:  file, file   | Triage Stage:
  validator, file validation,|  Unreviewed
  validator, file|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Reza Shakeri:

Old description:

> Hi, I wrote a file validator that can accredited the files based on their
> MIME and their size and extension, and all of these sections are
> implemented using their Django own features. I wanted to see I could add
> this feature to Django and give Pull Request
> If you want to upload the sample code to check.

New description:

 Hi, I wrote a file validator that can validation the files based on their
 MIME and their size and extension, and all of these sections are
 implemented using their Django own features. I wanted to see I could add
 this feature to Django and give Pull Request
 If you want to upload the sample code to check.

--

-- 
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/01070185bc5d5b93-2581b4eb-8a2d-4109-8156-104211fc9f95-00%40eu-central-1.amazonses.com.


[Django] #34263: file validator

2023-01-16 Thread Django
#34263: file validator
-+-
   Reporter:  Reza   |  Owner:  nobody
  Shakeri|
   Type:  New| Status:  new
  feature|
  Component:  File   |Version:  4.1
  uploads/storage|   Keywords:  file, file
   Severity:  Normal |  validator, file validation,
   Triage Stage: |  validator, file
  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Hi, I wrote a file validator that can accredited the files based on their
 MIME and their size and extension, and all of these sections are
 implemented using their Django own features. I wanted to see I could add
 this feature to Django and give Pull Request
 If you want to upload the sample code to check.

-- 
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/01070185bc5c911f-8dc67dba-7c89-49f5-a6aa-82b8a2591bef-00%40eu-central-1.amazonses.com.


Re: [Django] #34257: ForeignKeyRawIdWidget doesn't include vForeignKeyRawIdAdminField class when custom class passed in attrs

2023-01-16 Thread Django
#34257: ForeignKeyRawIdWidget doesn't include vForeignKeyRawIdAdminField class 
when
custom class passed in attrs
-+-
 Reporter:  Kevin Marsh  |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  dev
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:
  widget,admin,raw_id_fields |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kevin Marsh):

 Replying to [comment:1 Mariusz Felisiak]:

 Thanks Mariusz, hopefully at least this ticket will serve as instructions
 for others about how to ensure the JS in the widget still works when
 adding additional classes (although is at risk of breaking if
 `vForeignKeyRawIdAdminField` is ever renamed in a new version of Django).

 > As far as I'm aware, attributes passed in attrs override default values
 for all widgets

 Not sure that's entirely true, eg. I think something like
 `FilteredSelectMultiple` just ignores any "class" attr:

 {{{
 class FilteredSelectMultipleWidgetTest(SimpleTestCase):
 #... rest of existing test class
 def test_render_ignores_additional_attrs(self):
 # This widget ignores any class override in `attrs`
 w = widgets.FilteredSelectMultiple("test", False, attrs={"class":
 "myAdditionalClass"})
 self.assertHTMLEqual(
 w.render("test", "test"),
 '\n',
 )
 }}}

-- 
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/01070185bbe61526-808f9f3d-3814-4ff8-875b-31ee4a553bb5-00%40eu-central-1.amazonses.com.


[Django] #34262: Queryset grouped by annotation with aggregates on another annotated expression crashes on MySQL with sql_mode=only_full_group_by.

2023-01-16 Thread Django
#34262: Queryset grouped by annotation with aggregates on another annotated
expression crashes on MySQL with sql_mode=only_full_group_by.
-+-
   Reporter:  Mariusz|  Owner:  nobody
  Felisiak   |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  4.1
  layer (models, ORM)|   Keywords:  mysql
   Severity:  Normal |  only_full_group_by
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Queryset grouped by annotation with aggregates on another annotated
 expression crashed on MySQL with `sql_mode=only_full_group_by`, e.g.
 {{{#!python
 def test_group_by_nested_expression_with_params(self):
 books_qs = (
 Book.objects.annotate(greatest_pages=Greatest("pages",
 Value(600)))
 .values(
 "greatest_pages",
 )
 .annotate(
 min_pages=Min("pages"),
 least=Least("min_pages", "greatest_pages"),
 )
 .values_list("least", flat=True)
 )
 self.assertCountEqual(books_qs, [300, 946, 1132])
 }}}
 crashes with:
 {{{
 django.db.utils.OperationalError: (1055, "Expression #1 of SELECT list is
 not in GROUP BY clause and contains nonaggregated column
 'test_django_2.aggregation_book.pages' which is not functionally dependent
 on columns in GROUP BY clause; this is incompatible with
 sql_mode=only_full_group_by")
 }}}

-- 
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/01070185bbda77ce-a7da31f2-7290-4ef8-b068-b8f2c154a170-00%40eu-central-1.amazonses.com.


Re: [Django] #34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN are database-dependent.

2023-01-16 Thread Django
#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are database-dependent.
-+-
 Reporter:  Matt Cooper  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  floatfield   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 > In that test case, is the field null=True? In a brand new Django 4.1
 project with the following models.py pointing to a SQLite database:

 As for me it's a database caveat, and we cannot document all caveats in
 Django docs.

 > It's also curious that b92ffebb0cdc469baaf1b8f0e72dddb069eb2fb4 (#33954)
 explicitly made this unsupported where (at least) PostgreSQL does support
 `nan`, `+inf`, and `-inf`. Arguably I'd say that that was a backward
 incompatible change with no release note and people may already be
 depending on that support. Lack of support for these values is a database-
 specific thing.

 That's not exactly true. Folks were able to save objects with `nan` but
 they were not able to fetch them back from the database, so I don't see
 how someone can rely on this behavior.

-- 
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/01070185baa77e3d-6ad964fe-0d7d-47c3-87eb-d0f166087fd0-00%40eu-central-1.amazonses.com.


Re: [Django] #34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN are database-dependent.

2023-01-16 Thread Django
#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are database-dependent.
-+-
 Reporter:  Matt Cooper  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  floatfield   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Matt Cooper):

 Fixed the title, body, and added a new PR.
 https://github.com/django/django/pull/16461

-- 
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/01070185ba9b9b3d-0c3f5f26-f031-47ac-893c-3e40cb3a0d62-00%40eu-central-1.amazonses.com.


Re: [Django] #34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN are database-dependent. (was: models.FloatField documentation doesn't mention that +inf, -inf, and NaN are

2023-01-16 Thread Django
#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are database-dependent.
-+-
 Reporter:  Matt Cooper  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  floatfield   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Description changed by Matt Cooper:

Old description:

> The model field reference documentation doesn't mention that, in a
> FloatField, the values must pass `math.isfinite`. This excludes
> `float('inf')` (positive and negative) and `float('nan')`. I saw old
> discussion about why this is the case, but only after being bitten by it
> in a project. I'd like to submit a patch adding this info to the docs.

New description:

 The model field reference documentation doesn't mention that, in a
 FloatField, non-numeric values have database-dependent behavior.
 `float('nan')` on SQLite requires the field to be nullable, for example. I
 saw old discussion about why this is the case, but only after being bitten
 by it in a project. I'd like to submit a patch adding this info to the
 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/01070185ba9b2fc4-1d6635fd-b108-4c6e-8d9d-70caff7d382c-00%40eu-central-1.amazonses.com.


Re: [Django] #34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN are invalid.

2023-01-16 Thread Django
#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are invalid.
-+-
 Reporter:  Matt Cooper  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  floatfield   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Matt Cooper):

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


Comment:

 Ah, I made two mistakes in my research, covered below.

 I believe a scoped-down version of this proposed change is valid, because
 `float('nan')` is considered "null" (at least on SQLite). This is not
 obvious, and much like the "empty string vs null" discussion in CharField,
 would have helped me. The infinities do seem to work properly, so as
 mentioned above, this must be database-dependent.

 In that test case, is the field `null=True`? In a brand new Django 4.1
 project with the following `models.py` pointing to a SQLite database:

 {{{#!python
 from django.db import models

 class Example(models.Model):
 nullable_float = models.FloatField(null=True)
 nonnullable_float = models.FloatField()
 }}}

 then I get the following in `./manage.py shell`:

 {{{#!python
 >>> from repro.models import Example
 >>> e1 = Example(nullable_float=1.0, nonnullable_float=2.0)
 >>> e2 = Example(nullable_float=float('nan'), nonnullable_float=2.0)
 >>> e3 = Example(nullable_float=1.0, nonnullable_float=float('nan'))
 >>> e1.save()
 >>> e2.save()
 >>> e3.save()
 Traceback (most recent call last):
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-
 packages/django/db/backends/utils.py", line 89, in _execute
 return self.cursor.execute(sql, params)

   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-
 packages/django/db/backends/sqlite3/base.py", line 357, in execute
 return Database.Cursor.execute(self, query, params)

 sqlite3.IntegrityError: NOT NULL constraint failed:
 repro_example.nonnullable_float

 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "", line 1, in 
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-packages/django/db/models/base.py",
 line 812, in save
 self.save_base(
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-packages/django/db/models/base.py",
 line 863, in save_base
 updated = self._save_table(
   ^
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-packages/django/db/models/base.py",
 line 1006, in _save_table
 results = self._do_insert(
   
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-packages/django/db/models/base.py",
 line 1047, in _do_insert
 return manager._insert(

   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-
 packages/django/db/models/manager.py", line 85, in manager_method
 return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-packages/django/db/models/query.py",
 line 1791, in _insert
 return query.get_compiler(using=using).execute_sql(returning_fields)
^
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-
 packages/django/db/models/sql/compiler.py", line 1660, in execute_sql
 cursor.execute(sql, params)
   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-
 packages/django/db/backends/utils.py", line 103, in execute
 return super().execute(sql, params)

   File "/Users/vtbassmatt/Library/Caches/pypoetry/virtualenvs/django34260
 -KHbD0UBT-py3.11/lib/python3.11/site-
 packages/django/db/

Re: [Django] #34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN are invalid.

2023-01-16 Thread Django
#34260: models.FloatField documentation doesn't mention that +inf, -inf, and NaN
are invalid.
-+-
 Reporter:  Matt Cooper  |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  floatfield   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Nick Pope):

 I suppose it would make sense to add the above tests. It'd probably also
 make sense to round-trip the value to make sure that it is actually
 supported...

 It's also curious that b92ffebb0cdc469baaf1b8f0e72dddb069eb2fb4 (#33954)
 explicitly made this unsupported where (at least) PostgreSQL does support
 `nan`, `+inf`, and `-inf`. Arguably I'd say that that was a backward
 incompatible change with no release note and people may already be
 depending on that support. Lack of support for these values is a database-
 specific thing.

-- 
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/01070185ba7e94f1-db5c41c5-8b38-4cf0-86b2-283b4ea35a0e-00%40eu-central-1.amazonses.com.


Re: [Django] #34254: Exists annotations can return non-boolean results (i.e. None) if used with an empty QuerySet.

2023-01-16 Thread Django
#34254: Exists annotations can return non-boolean results (i.e. None) if used 
with
an empty QuerySet.
-+-
 Reporter:  Keryn Knight |Owner:
 |  rajdesai24
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  Exists   | Triage Stage:  Accepted
  EmptyQuerySet sqlite postgres  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Keryn Knight):

 Replying to [comment:1 Simon Charette]:

 > I suspect the solution is as simple as setting
 `Exists.empty_result_set_value = False` [...]
 > [...]
 > If you can confirm this addresses the problem you reported [...]

 Confirming, it does seem to be as simple as that (a pleasant rarity in ORM
 edge cases, I'm sure!) for the 2 backends I was testing (`postgres` and
 `sqlite` -- I've notably not checked `mysql` or `oracle` etc):

 {{{
 In [3]:
 
A.objects.using("sqlite").annotate(should_be_bool=Exists(B.objects.none())).first().should_be_bool
 Out[3]: False

 In [4]:
 
A.objects.using("pg").annotate(should_be_bool=Exists(B.objects.none())).first().should_be_bool
 Out[4]: False
 }}}

 The queries are still recorded as different, but I expect that's normal
 coercion differences between sqlite & postgres:
 {{{
 In [6]: connections['sqlite'].queries
 Out[6]:
 [{'sql': 'SELECT "app_a"."id", 0 AS "should_be_bool" FROM "app_a" ORDER BY
 "app_a"."id" ASC LIMIT 1',
   'time': '0.001'}]

 In [7]: connections['pg'].queries
 Out[7]:
 [{'sql': 'SELECT "app_a"."id", false AS "should_be_bool" FROM "app_a"
 ORDER BY "app_a"."id" ASC LIMIT 1',
   'time': '0.001'}]
 }}}

 ---

 WRT to fixing it, as rajdesai24 has expressed an interest in doing so,
 I'll let them take the lead and get the contribution under their belt.

 Replying to [comment:3 rajdesai24]:
 > Hey Simon would love to submit 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/01070185ba7ca48f-15f16ecb-1fc9-4edc-85fe-58d56f6e0bb8-00%40eu-central-1.amazonses.com.


Re: [Django] #34255: Annotation/group by with an expression on psycopg3

2023-01-16 Thread Django
#34255: Annotation/group by with an expression on psycopg3
-+-
 Reporter:  Guillaume Andreu |Owner:  Mariusz
  Sabater|  Felisiak
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  orm postgres | Triage Stage:  Accepted
  psycopg3 annotation groupby|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * owner:  nobody => Mariusz Felisiak
 * status:  new => assigned
 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/16460 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/01070185ba1d359a-cc0b7745-66a3-440b-8536-b81a7846a428-00%40eu-central-1.amazonses.com.


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

2023-01-16 Thread Django
#23718: TEST_MIRROR setting doesn't work as expected (and has no tests)
-+-
 Reporter:  Ilya Baryshev|Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  closed
Component:  Documentation|  Version:  1.7
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  replica testing  | 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:"0fbdb9784da915fce5dcc1fe82bac9b4785749e5" 0fbdb97]:
 {{{
 #!CommitTicketReference repository=""
 revision="0fbdb9784da915fce5dcc1fe82bac9b4785749e5"
 Fixed #23718 -- Doc'd that test mirrors require TransactionTestCase.

 Co-authored-by: Christian Bundy 
 }}}

-- 
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/01070185b9d2c734-54d394d9-bd45-47e6-9eab-23b5e2035db2-00%40eu-central-1.amazonses.com.


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

2023-01-16 Thread Django
#23718: TEST_MIRROR setting doesn't work as expected (and has no tests)
-+-
 Reporter:  Ilya Baryshev|Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  closed
Component:  Documentation|  Version:  1.7
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  replica testing  | 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:"d550e3cccd77ceaea0d77fd2df472454a238a62e" d550e3c]:
 {{{
 #!CommitTicketReference repository=""
 revision="d550e3cccd77ceaea0d77fd2df472454a238a62e"
 [4.1.x] Fixed #23718 -- Doc'd that test mirrors require
 TransactionTestCase.

 Co-authored-by: Christian Bundy 

 Backport of 0fbdb9784da915fce5dcc1fe82bac9b4785749e5 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/01070185b9d2a7a8-a589f486-9ac5-40e2-81bf-de0def3e3862-00%40eu-central-1.amazonses.com.


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

2023-01-16 Thread Django
#23718: TEST_MIRROR setting doesn't work as expected (and has no tests)
-+-
 Reporter:  Ilya Baryshev|Owner:  Sarah
 |  Boyce
 Type:  Bug  |   Status:  assigned
Component:  Documentation|  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  replica testing  | 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/01070185b9b5547a-d11ee03a-228d-4a69-a7de-d6a8dc5a3b01-00%40eu-central-1.amazonses.com.


Re: [Django] #30129: Allow creating models with fields values as a Subquery() with F() expressions

2023-01-16 Thread Django
#30129: Allow creating models with fields values as a Subquery() with F()
expressions
-+-
 Reporter:  Charlie McBride  |Owner:  Sarah
 |  Boyce
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  Subquery, F, Query   | Triage Stage:  Accepted
  Expressions|
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


-- 
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/01070185b99ee2fa-aa854c42-9c96-42d1-9d6a-65b9e09bd2dd-00%40eu-central-1.amazonses.com.


Re: [Django] #30129: Allow creating models with fields values as a Subquery() with F() expressions

2023-01-16 Thread Django
#30129: Allow creating models with fields values as a Subquery() with F()
expressions
-+-
 Reporter:  Charlie McBride  |Owner:  Sarah
 |  Boyce
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  Subquery, F, Query   | Triage Stage:  Accepted
  Expressions|
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:"05bcd5baafc0a5783923e32d2b7e2b7fff7d152a" 05bcd5ba]:
 {{{
 #!CommitTicketReference repository=""
 revision="05bcd5baafc0a5783923e32d2b7e2b7fff7d152a"
 Refs #30129 -- Added test for create() with F() expression in Subquery.

 Fixed in 35431298226165986ad07e91f9d3aca721ff38ec.
 }}}

-- 
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/01070185b99e10a2-c86a07a9-077f-4c6e-aaf4-1ba62363422e-00%40eu-central-1.amazonses.com.