Re: [Django] #30234: Disallow non-uppercase settings in settings.configure()

2021-07-26 Thread Django
#30234: Disallow non-uppercase settings in settings.configure()
--+
 Reporter:  orlnub123 |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (Other)  |  Version:  dev
 Severity:  Normal|   Resolution:  fixed
 Keywords:  settings  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Mariusz Felisiak):

 Replying to [comment:7 k4ml]:
 > Btw the fix is simple actually, add:-
 >
 >
 > del _
 >
 > at the end of settings.py. The localization docs should add this in
 notes.

 It's not an issue in Django or its docs. It's an issue in
 `pytest_djangoapp`. `_` is not a setting name and should not be passed to
 the `.configure()`.

-- 
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/067.c75b896a20d4f52e655d1001678b2515%40djangoproject.com.


Re: [Django] #32933: Point users to BoundField.initial instead of Form.get_initial_for_field()

2021-07-26 Thread Django
#32933: Point users to BoundField.initial instead of 
Form.get_initial_for_field()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Chris
 Type:   |  Jerdonek
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  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 Carlton Gibson):

 * 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/067.1efb809bdf8936ae71a1f5107cf58358%40djangoproject.com.


Re: [Django] #30234: Disallow non-uppercase settings in settings.configure()

2021-07-26 Thread Django
#30234: Disallow non-uppercase settings in settings.configure()
--+
 Reporter:  orlnub123 |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (Other)  |  Version:  dev
 Severity:  Normal|   Resolution:  fixed
 Keywords:  settings  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by k4ml):

 Replying to [comment:6 Mariusz Felisiak]:

 > This ticket has nothing to do with using `_` in `settings.py`, it's
 about non-uppercase setting names.

 `_` failed `isupper()` check.

 Btw the fix is simple actually, add:-

 ```
 del _
 ```

 at the end of settings.py. The localization docs should add this in notes.

-- 
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/067.81440667f232784c66b81fd29ab1a5c1%40djangoproject.com.


Re: [Django] #32743: Migrations don't alter foreign key data types when referencing primary keys in MTI models.

2021-07-26 Thread Django
#32743: Migrations don't alter foreign key data types when referencing primary 
keys
in MTI models.
-+-
 Reporter:  Mariusz Felisiak |Owner:  David
 |  Wobrock
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  3.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:"3d9040a50b160f8b4bb580e09f4120d4979fe29e" 3d9040a5]:
 {{{
 #!CommitTicketReference repository=""
 revision="3d9040a50b160f8b4bb580e09f4120d4979fe29e"
 Refs #32743 -- Fixed recreation of foreign key constraints when altering
 type of referenced primary key with MTI.

 Follow up to 325d7710ce9f6155bb55610ad6b4580d31263557.
 }}}

-- 
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/065.1279b0f2a9852a291e207d0d6fd0ee35%40djangoproject.com.


Re: [Django] #30234: Disallow non-uppercase settings in settings.configure()

2021-07-26 Thread Django
#30234: Disallow non-uppercase settings in settings.configure()
--+
 Reporter:  orlnub123 |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (Other)  |  Version:  dev
 Severity:  Normal|   Resolution:  fixed
 Keywords:  settings  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Mariusz Felisiak):

 Replying to [comment:5 k4ml]:
 > The docs still showing example that using `_` in settings.py -
 
https://github.com/django/django/blob/7f33c1e22dbc34a7afae7967783725b10f1f13b1/docs/ref/settings.txt#L1951
 >
 > And this check cause issue when third party app is calling
 settings.configure():-
 >
 > https://github.com/idlesign/pytest-
 djangoapp/blob/master/pytest_djangoapp/plugin.py#L42
 >
 > If this is no longer recommended practice, the docs above should be
 fixed not to use `_` anymore in settings.py.

 This ticket has nothing to do with using `_` in `settings.py`, it's about
 non-uppercase setting names.

-- 
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/067.20e7c8341aa68ffa620f53922dabfccb%40djangoproject.com.


Re: [Django] #30234: Disallow non-uppercase settings in settings.configure()

2021-07-26 Thread Django
#30234: Disallow non-uppercase settings in settings.configure()
--+
 Reporter:  orlnub123 |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (Other)  |  Version:  dev
 Severity:  Normal|   Resolution:  fixed
 Keywords:  settings  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by k4ml):

 The docs still showing example that using `_` in settings.py -
 
https://github.com/django/django/blob/7f33c1e22dbc34a7afae7967783725b10f1f13b1/docs/ref/settings.txt#L1951

 And this check cause issue when third party app is calling
 settings.configure():-

 https://github.com/idlesign/pytest-
 djangoapp/blob/master/pytest_djangoapp/plugin.py#L42

 If this is no longer recommended practice, the docs above should be fixed
 not to use `_` anymore in settings.py.

-- 
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/067.6d5568be9e9f4bf151e755acfdedb9bb%40djangoproject.com.


Re: [Django] #32743: Migrations don't alter foreign key data types when referencing primary keys in MTI models.

2021-07-26 Thread Django
#32743: Migrations don't alter foreign key data types when referencing primary 
keys
in MTI models.
-+-
 Reporter:  Mariusz Felisiak |Owner:  David
 |  Wobrock
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  3.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 Keryn Knight):

 There's an additional PR which been made which alludes to a situation
 missed by the original fix: https://github.com/django/django/pull/14700
 I can't speak for the veracity of it as I haven't been following the
 details of the ticket, but it's probably worth someone glancing at it and
 rolling it into this ticket's fix log if appropriate.

-- 
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/065.b0d8367a14578b41fe3b10f6fc7323be%40djangoproject.com.


Re: [Django] #32962: Consolidate string concatenations in BaseDatabaseSchemaEditor.column_sql()

2021-07-26 Thread Django
#32962: Consolidate string concatenations in 
BaseDatabaseSchemaEditor.column_sql()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Chris
 Type:   |  Jerdonek
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Chris Jerdonek):

 * has_patch:  0 => 1


Comment:

 PR: https://github.com/django/django/pull/14701

-- 
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/067.e11ea8a0a5922cb40e316227101b9bc4%40djangoproject.com.


Re: [Django] #32948: Optimise Q combination and inversion

2021-07-26 Thread Django
#32948: Optimise Q combination and inversion
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Keryn Knight):

 * has_patch:  0 => 1


Comment:

 I don't ''think'' readability has been hurt by the change; I could argue
 that it's been improved even, perhaps. Do judge for yourselves, naturally.

 At this point there's 2 PRs to look at:
 my original one: https://github.com/django/django/pull/14673
 Nick P's one based on mine above:
 https://github.com/django/django/pull/14677

 Please note that the discussion about Nick's variant happened in-line in
 my PR, as regrettably I didn't see the other PR until ''after'' we'd
 started discussing the changes.

-- 
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/067.8abaa17c6a9de909fc99777de9cdfe5a%40djangoproject.com.


Re: [Django] #32946: Prefer non-kwargs construction of dynamically generated Q objects

2021-07-26 Thread Django
#32946: Prefer non-kwargs construction of dynamically generated Q objects
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Keryn Knight):

 * needs_better_patch:  0 => 1
 * has_patch:  0 => 1


Comment:

 PR is https://github.com/django/django/pull/14699
 As I write this, CI is still running, but I've set patch needs improvement
 based on not having removed the imports for `functools`/`operator` ...

-- 
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/067.4e233ea436c3cf073e4d891e2dbc8e36%40djangoproject.com.


[Django] #32964: Change "setup" to "set up".

2021-07-26 Thread Django
#32964: Change "setup" to "set up".
+
   Reporter:  Nat S Dunn|  Owner:  nobody
   Type:  Cleanup/optimization  | Status:  new
  Component:  Documentation |Version:  3.2
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  1
  UI/UX:  0 |
+
 The first sentence of
 [https://docs.djangoproject.com/en/3.2/intro/tutorial02/ part 2 of the
 tutorial] should be changed from:

 We’ll **setup** the database...

 to

 We’ll **set up** the database...

-- 
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/051.4f7a2bbf92b3c821abf255ec4e39f4c9%40djangoproject.com.


Re: [Django] #32948: Optimise Q combination and inversion

2021-07-26 Thread Django
#32948: Optimise Q combination and inversion
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Claude Paroz):

 +1 to privilege readability over micro-optimization, if such a choice has
 to be made.

-- 
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/067.82ee561426d49e5cb9cec7b259bef9ea%40djangoproject.com.


Re: [Django] #32948: Optimise Q combination and inversion

2021-07-26 Thread Django
#32948: Optimise Q combination and inversion
-+-
 Reporter:  Keryn Knight |Owner:  Keryn
 Type:   |  Knight
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted


Comment:

 Tentatively accepted, readability with the proposed patch is crucial to
 me.

-- 
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/067.cf2bbca250d0a244f6838f5d30dfbb09%40djangoproject.com.


Re: [Django] #32963: Combination of filter on the annotation and random order. (was: Bug: combination of filter on the annotation and random order.)

2021-07-26 Thread Django
#32963: Combination of filter on the annotation and random order.
-+-
 Reporter:   |Owner:  nobody
  likecodeingloveproblems|
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  3.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  Random + Group By| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

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


Comment:

 Duplicate of #26390 (fixed in Django 3.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/081.dc3cd73727b7374ab90c20b49e875dca%40djangoproject.com.


Re: [Django] #32963: Bug: combination of filter on the annotation and random order.

2021-07-26 Thread Django
#32963: Bug: combination of filter on the annotation and random order.
-+-
 Reporter:   |Owner:  nobody
  likecodeingloveproblems|
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  3.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  Random + Group By| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by likecodeingloveproblems):

 The difference is here:

 ORM:
 GROUP BY "nakhll_market_shop"."ID" **, RANDOM()** HAVING
 COUNT("nakhll_market_product"."ID") > 1 ORDER BY RANDOM()

 CORRECT:
 GROUP BY "nakhll_market_shop"."ID" HAVING
 COUNT("nakhll_market_product"."ID") > 1 ORDER BY RANDOM()

-- 
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/081.1f44462d7d3dcf9e483db51a7d3f41b1%40djangoproject.com.


Re: [Django] #32963: Bug: combination of filter on the annotation and random order.

2021-07-26 Thread Django
#32963: Bug: combination of filter on the annotation and random order.
-+-
 Reporter:   |Owner:  nobody
  likecodeingloveproblems|
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  3.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  Random + Group By| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by likecodeingloveproblems:

Old description:

> I have a query like:
> In [6]: Shop.objects\
>...: .annotate(product_count = Count('ShopProduct'))\
>...: .filter(product_count__gt=1)\
>...: .order_by('?')
> Out[6]: 
>
> but the out put is empty!
> if i remove order_by('?') it works, and the same for the
> filter(product_count__gt=1).
> I get the SQL from connection.queries:
>
> SELECT ..., COUNT("nakhll_market_product"."ID") AS "product_count" FROM
> "nakhll_market_shop" LEFT OUTER JOIN "nakhll_market_product" ON
> ("nakhll_market_shop"."ID" = "nakhll_market_product"."FK_Shop_id") GROUP
> BY "nakhll_market_shop"."ID", RANDOM() HAVING
> COUNT("nakhll_market_product"."ID") > 1 ORDER BY RANDOM() ASC
>
> but this SQL works correctly:
>
> SELECT
> ... ,
> COUNT("nakhll_market_product"."ID") AS "product_count"
> FROM "nakhll_market_shop"
>  LEFT OUTER JOIN
>  "nakhll_market_product" ON ("nakhll_market_shop"."ID" =
> "nakhll_market_product"."FK_Shop_id")
>  WHERE ("nakhll_market_shop"."Available" AND
> "nakhll_market_shop"."Publish")
>  GROUP BY "nakhll_market_shop"."ID" HAVING
> COUNT("nakhll_market_product"."ID") > 1
>  ORDER BY RANDOM()

New description:

 I have a query like:
 In [6]: Shop.objects\
...: .annotate(product_count = Count('ShopProduct'))\
...: .filter(product_count__gt=1)\
...: .order_by('?')
 Out[6]: 

 but the out put is empty!
 if i remove order_by('?') it works, and the same for the
 filter(product_count__gt=1).
 I get the SQL from connection.queries:

 SELECT ..., COUNT("nakhll_market_product"."ID") AS "product_count" FROM
 "nakhll_market_shop" LEFT OUTER JOIN "nakhll_market_product" ON
 ("nakhll_market_shop"."ID" = "nakhll_market_product"."FK_Shop_id") GROUP
 BY "nakhll_market_shop"."ID", RANDOM() HAVING
 COUNT("nakhll_market_product"."ID") > 1 ORDER BY RANDOM() ASC

 but this SQL works correctly:

 SELECT
 ... ,
 COUNT("nakhll_market_product"."ID") AS "product_count"
 FROM "nakhll_market_shop"
 LEFT OUTER JOIN
 "nakhll_market_product" ON ("nakhll_market_shop"."ID" =
 "nakhll_market_product"."FK_Shop_id")
 WHERE ("nakhll_market_shop"."Available" AND
 "nakhll_market_shop"."Publish")
 GROUP BY "nakhll_market_shop"."ID" HAVING
 COUNT("nakhll_market_product"."ID") > 1
 ORDER BY RANDOM()

--

-- 
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/081.cbe1fd2590509ea15a80c344e8efe774%40djangoproject.com.


Re: [Django] #32963: Bug: combination of filter on the annotation and random order.

2021-07-26 Thread Django
#32963: Bug: combination of filter on the annotation and random order.
-+-
 Reporter:   |Owner:  nobody
  likecodeingloveproblems|
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  3.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  Random + Group By| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by likecodeingloveproblems:

Old description:

> I have a query like:
> In [6]: Shop.objects\
>...: .annotate(product_count = Count('ShopProduct'))\
>...: .filter(product_count__gt=1)\
>...: .order_by('?')
> Out[6]: 
>
> but the out put is empty!
> if i remove order_by('?') it works, and the same for the
> filter(product_count__gt=1).
> I get the SQL from connection.queries:
>
> SELECT ..., COUNT("nakhll_market_product"."ID") AS "product_count" FROM
> "nakhll_market_shop" LEFT OUTER JOIN "nakhll_market_product" ON
> ("nakhll_market_shop"."ID" = "nakhll_market_product"."FK_Shop_id") GROUP
> BY "nakhll_market_shop"."ID", RANDOM() HAVING
> COUNT("nakhll_market_product"."ID") > 1 ORDER BY RANDOM() ASC
>
> but this SQL works correctly:
>
> SELECT
> ... ,
> COUNT("nakhll_market_product"."ID") AS "product_count"
> FROM "nakhll_market_shop"
> LEFT OUTER JOIN
> "nakhll_market_product" ON ("nakhll_market_shop"."ID" =
> "nakhll_market_product"."FK_Shop_id")
> WHERE ("nakhll_market_shop"."Available" AND
> "nakhll_market_shop"."Publish")
> GROUP BY "nakhll_market_shop"."ID" HAVING
> COUNT("nakhll_market_product"."ID") > 1
> ORDER BY RANDOM()

New description:

 I have a query like:
 In [6]: Shop.objects\
...: .annotate(product_count = Count('ShopProduct'))\
...: .filter(product_count__gt=1)\
...: .order_by('?')
 Out[6]: 

 but the out put is empty!
 if i remove order_by('?') it works, and the same for the
 filter(product_count__gt=1).
 I get the SQL from connection.queries:

 SELECT ..., COUNT("nakhll_market_product"."ID") AS "product_count" FROM
 "nakhll_market_shop" LEFT OUTER JOIN "nakhll_market_product" ON
 ("nakhll_market_shop"."ID" = "nakhll_market_product"."FK_Shop_id") GROUP
 BY "nakhll_market_shop"."ID", RANDOM() HAVING
 COUNT("nakhll_market_product"."ID") > 1 ORDER BY RANDOM() ASC

 but this SQL works correctly:

 SELECT
 ... ,
 COUNT("nakhll_market_product"."ID") AS "product_count"
 FROM "nakhll_market_shop"
  LEFT OUTER JOIN
  "nakhll_market_product" ON ("nakhll_market_shop"."ID" =
 "nakhll_market_product"."FK_Shop_id")
  WHERE ("nakhll_market_shop"."Available" AND
 "nakhll_market_shop"."Publish")
  GROUP BY "nakhll_market_shop"."ID" HAVING
 COUNT("nakhll_market_product"."ID") > 1
  ORDER BY RANDOM()

--

-- 
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/081.16a273377c9e9ff5ac194c338f46bb28%40djangoproject.com.


Re: [Django] #32906: Explain JSONBAgg benefit

2021-07-26 Thread Django
#32906: Explain JSONBAgg benefit
-+-
 Reporter:  Claude Paroz |Owner:  Abhyudai
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Documentation|  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:"5a634a7b6f248e5dead65f420ec5d30acd9724bf" 5a634a7b]:
 {{{
 #!CommitTicketReference repository=""
 revision="5a634a7b6f248e5dead65f420ec5d30acd9724bf"
 Fixed #32906 -- Added docs and tests for using key and index lookups on
 JSONBAgg results.

 Co-authored-by: Mariusz Felisiak 
 }}}

-- 
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/065.4c6696b8f64210151b0a0e6ca428579a%40djangoproject.com.


[Django] #32963: Bug: combination of filter on the annotation and random order.

2021-07-26 Thread Django
#32963: Bug: combination of filter on the annotation and random order.
-+-
   Reporter: |  Owner:  nobody
  likecodeingloveproblems|
   Type:  Bug| Status:  new
  Component:  Database   |Version:  3.1
  layer (models, ORM)|
   Severity:  Normal |   Keywords:  Random + Group By
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 I have a query like:
 In [6]: Shop.objects\
...: .annotate(product_count = Count('ShopProduct'))\
...: .filter(product_count__gt=1)\
...: .order_by('?')
 Out[6]: 

 but the out put is empty!
 if i remove order_by('?') it works, and the same for the
 filter(product_count__gt=1).
 I get the SQL from connection.queries:

 SELECT ..., COUNT("nakhll_market_product"."ID") AS "product_count" FROM
 "nakhll_market_shop" LEFT OUTER JOIN "nakhll_market_product" ON
 ("nakhll_market_shop"."ID" = "nakhll_market_product"."FK_Shop_id") GROUP
 BY "nakhll_market_shop"."ID", RANDOM() HAVING
 COUNT("nakhll_market_product"."ID") > 1 ORDER BY RANDOM() ASC

 but this SQL works correctly:

 SELECT
 ... ,
 COUNT("nakhll_market_product"."ID") AS "product_count"
 FROM "nakhll_market_shop"
 LEFT OUTER JOIN
 "nakhll_market_product" ON ("nakhll_market_shop"."ID" =
 "nakhll_market_product"."FK_Shop_id")
 WHERE ("nakhll_market_shop"."Available" AND
 "nakhll_market_shop"."Publish")
 GROUP BY "nakhll_market_shop"."ID" HAVING
 COUNT("nakhll_market_product"."ID") > 1
 ORDER BY RANDOM()

-- 
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/066.1ff953466d5cdeb95fe148dd32566566%40djangoproject.com.


Re: [Django] #25264: Misleading list of options available for manage.py commands

2021-07-26 Thread Django
#25264: Misleading list of options available for manage.py commands
-+-
 Reporter:  Maxime Lorant|Owner:  Jan Szoja
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1
 * needs_tests:  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/065.47383c85ac1b7d1579c2ae766267a7ca%40djangoproject.com.


Re: [Django] #32962: Consolidate string concatenations in BaseDatabaseSchemaEditor.column_sql()

2021-07-26 Thread Django
#32962: Consolidate string concatenations in 
BaseDatabaseSchemaEditor.column_sql()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Chris
 Type:   |  Jerdonek
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted


Comment:

 Tentatively accepted, so we can see what a patch looks like .

-- 
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/067.762aa52738e5f2c7a6ae1098601e4fcb%40djangoproject.com.


Re: [Django] #32906: Explain JSONBAgg benefit

2021-07-26 Thread Django
#32906: Explain JSONBAgg benefit
-+-
 Reporter:  Claude Paroz |Owner:  Abhyudai
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Documentation|  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/065.3f7df17924b6a6009dd9c0fe7cc5c461%40djangoproject.com.


Re: [Django] #32906: Explain JSONBAgg benefit

2021-07-26 Thread Django
#32906: Explain JSONBAgg benefit
--+
 Reporter:  Claude Paroz  |Owner:  Abhyudai
 Type:  Cleanup/optimization  |   Status:  assigned
Component:  Documentation |  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 Abhyudai):

 * 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/065.e903707a0e9f9f5c9a5d1a1cbd1da43a%40djangoproject.com.


Re: [Django] #32956: Modernise spellings of Web, Email et al

2021-07-26 Thread Django
#32956: Modernise spellings of Web, Email et al
-+-
 Reporter:  David Smith  |Owner:  David
 Type:   |  Smith
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  3.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 Hey David. Good work! :)

 I think best to keep the scope narrow, otherwise it gets unwieldy — it
 becomes impossible to say when the ticket is addressed. (We can always add
 `Refs` commits, or small ones under the typos don't need a ticket rule.)
 But, yes, if we can make the style more consistent, presumably that's for
 the win.

-- 
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/066.dd67925975662baa0a16554c00654403%40djangoproject.com.


Re: [Django] #32743: Migrations don't alter foreign key data types when referencing primary keys in MTI models.

2021-07-26 Thread Django
#32743: Migrations don't alter foreign key data types when referencing primary 
keys
in MTI models.
-+-
 Reporter:  Mariusz Felisiak |Owner:  David
 |  Wobrock
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  3.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:"325d7710ce9f6155bb55610ad6b4580d31263557" 325d7710]:
 {{{
 #!CommitTicketReference repository=""
 revision="325d7710ce9f6155bb55610ad6b4580d31263557"
 Fixed #32743 -- Added foreign key altering when altering type of
 referenced primary key with MTI.
 }}}

-- 
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/065.233045ab4f789fdd2cb9f432dff8c098%40djangoproject.com.


Re: [Django] #32956: Modernise spellings of Web, Email et al

2021-07-26 Thread Django
#32956: Modernise spellings of Web, Email et al
-+-
 Reporter:  David Smith  |Owner:  David
 Type:   |  Smith
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  3.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by David Smith):

 > AP Styleguide should be treated as the Black for writing

 I've purchased a copy of the stylebook and I've already spotted a few
 words where the recomended approach is not followed. e.g. It is Afterward
 not afterwards (the latter seems to be "British"), also it's Adviser not
 Advisor.

 I wonder if the scope of this ticket could be widened to capture adherence
 to the AP Stylebook rather than than just a few words?

 We should still assess each change on it's own merrits.

-- 
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/066.a44e2d0e479d269811184fd9ce80c97a%40djangoproject.com.