Re: [Django] #29062: "database table locked errors" when using sqlite in-memory database with LiveServerTestCase

2022-11-23 Thread Django
#29062: "database table locked errors" when using sqlite in-memory database with
LiveServerTestCase
-+-
 Reporter:  Juozas Masiulis  |Owner:
 |  Christophe Baldy
 Type:  Bug  |   Status:  assigned
Component:  Testing framework|  Version:  2.0
 Severity:  Normal   |   Resolution:
 Keywords:  sqlite, testing, | Triage Stage:  Ready for
  databases  |  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/01070184a808474d-617cf31c-35d2-4ac4-94c8-ac5af934d77c-00%40eu-central-1.amazonses.com.


Re: [Django] #34151: Adding explicit primary key with different type doesn't update related ManyToManyFields.

2022-11-23 Thread Django
#34151: Adding explicit primary key with different type doesn't update related
ManyToManyFields.
-+-
 Reporter:  STANISLAV LEPEKHOV   |Owner:  Bhuvnesh
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  migrations pk uuid   | Triage Stage:  Accepted
  relation   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by STANISLAV LEPEKHOV):

 Replying to [comment:8 Aravind Swaminathan]:
 > Does this problem occur only while using a uuid field or even with other
 type fields as primary key?

 I found an error when changing the type to UUID, I did not check with
 other types of fields.

-- 
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/01070184a7cd5693-bc093d1f-24a5-46e8-bb59-0f5a2b4e6278-00%40eu-central-1.amazonses.com.


Re: [Django] #32263: squashmigrations produces incorrect result with a RenameModel on a ForeignKey target.

2022-11-23 Thread Django
#32263: squashmigrations produces incorrect result with a RenameModel on a
ForeignKey target.
-+-
 Reporter:  InvalidInterrupt |Owner:  Anvesh
 |  Mishra
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  3.1
 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 Anvesh Mishra):

 A regression test for this ticket would look something like this:
 {{{#!python
 def test_squashmigrations_rename_foreign_key(self):

 out = io.StringIO()
 with self.temporary_migration_module(
 module="migrations.test_migrations_rename"
 ) as migration_dir:
 call_command(
 "squashmigrations",
 "migrations",
 "0003",
 interactive=False,
 stdout=out,
 no_color=True,
 )
 squashed_migration_file = os.path.join(
 migration_dir, "0001_squashed_0003_third.py"
 )
 with open(squashed_migration_file, encoding="utf-8") as fp:
 content = fp.read()
 self.assertIn('to="migrations.person"',content)
 self.assertTrue(os.path.exists(squashed_migration_file))
 self.assertEqual(
 out.getvalue(),
 f"Will squash the following migrations:\n"
 f" - 0001_initial\n"
 f" - 0002_second\n"
 f" - 0003_third\n"
 f"Optimizing...\n"
 f"  Optimized from 4 operations to 2 operations.\n"
 f"Created new squashed migration {squashed_migration_file}\n"
 f"  You should commit this migration but leave the old ones in
 place;\n"
 f"  the new migration will be used for new installs. Once you
 are sure\n"
 f"  all instances of the codebase have applied the migrations
 you "
 f"squashed,\n"
 f"  you can delete them.\n",
 )
 }}}
 By running this test I found out that the base migration objects created
 are of `CreateModel` so we need to somehow change the functionality of
 this section of `CreateModel.reduce()`:
 {{{#!python
 def reduce(self,operation,app_label):
 ...
 elif (
 isinstance(operation, RenameModel)
 and self.name_lower == operation.old_name_lower
 ):
 return [
 CreateModel(
 operation.new_name,
 fields=self.fields,
 options=self.options,
 bases=self.bases,
 managers=self.managers,
 ),
 ]
 }}}
 to something like:
 {{{#!python
 def reduce(self,operation,app_label):
 ...
 elif (
 isinstance(operation, RenameModel)
 and self.name_lower == operation.old_name_lower
 ):
 return operation.reduce(operation,app_label)
 }}}
 and changing the functionality of `RenameModel.reduce()`. I hope I'm
 clear.

-- 
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/01070184a64e6dd9-8bc9b483-03fa-4c85-8e15-d484a37c7a58-00%40eu-central-1.amazonses.com.


Re: [Django] #33651: Support prefetch GenericForeignKey with custom queryset.

2022-11-23 Thread Django
#33651: Support prefetch GenericForeignKey with custom queryset.
-+-
 Reporter:  elonzh   |Owner:
 |  Gullapalli Saisurya Revanth
 Type:  New feature  |   Status:  assigned
Component:   |  Version:  4.0
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:  GenericForeignKey| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by revanthgss):

 Hi,

 I think there is no way to add two lookups on same foreign key on same
 model as currently we populate the prefetch cache for this foreign key.
 Anyway, for a generic foreign key currently giving a queryset is not
 supported. To add this support I think the best way is to have a class
 that extends the prefetch class which handles all the custom logic of
 prefetching which is what we are working on in this issue.

 To implement what you said i.e adding two Prefetch of content object in
 prefetch_related function. Some of the logic will need to be handled in
 the prefetch_related function which is not good.

 Replying to [comment:19 Todor Velichkov]:
 > Hi everyone, I took a brief look at the conversation in the pull request
 [https://github.com/django/django/pull/15636 #15636]  and I have a
 question about the issue being discussed there (passing list of querysets
 into an queryset argument).
 >
 > Is there anything specific about this, that is enforcing the use of a
 list of querysets? Is it possible to send as many `GenericPrefetch`
 objects as the number of querysets being required ? For example:
 > {{{
 > Node.objects.prefetch_related(
 > GenericPrefetch("content_object", queryset=ItemA.objects.all()),
 > GenericPrefetch("content_object", queryset=ItemB.objects.all()),
 > )
 > }}}
 > this is in the spirit of the current `Prefetch` class, which actually
 allows you to prefetch multiple levels of objects, splitted into different
 prefetch calls. i.e:
 > {{{
 > Book.objects.prefetch_related(
 > Prefetch("author", queryset=Author.objects.all()),
 > Prefetch("author__house", queryset=House.objects.all()),
 > )
 > }}}
 > And now I'm a little bit repeating myself with ticket [ticket:24272],
 but this could probably open the door for reusing `related_query_name`
 when there is a defined `GenericRelation` which could give us the
 following interface w/o using the generic `content_object` argument:
 > {{{
 > TaggedItem.objects.all().prefetch_related(
 > GenericPrefetch('books',
 queryset=Book.objects.all().select_related('author')),
 > GenericPrefetch('movies',
 queryset=Movie.objects.all().select_related('director')),
 > )
 > }}}

-- 
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/01070184a5b57d68-1f74011a-080c-4ba2-b441-c31422042de1-00%40eu-central-1.amazonses.com.


Re: [Django] #31679: Django subtly produces incorrect query when the same keyword appears in both aggregate() and annotate()

2022-11-23 Thread Django
#31679: Django subtly produces incorrect query when the same keyword appears in
both aggregate() and annotate()
-+-
 Reporter:  StefanosChaliasos|Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  3.0
  (models, ORM)  |
 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:"1297c0d0d76a708017fe196b61a0ab324df76954" 1297c0d]:
 {{{
 #!CommitTicketReference repository=""
 revision="1297c0d0d76a708017fe196b61a0ab324df76954"
 Fixed #31679 -- Delayed annotating aggregations.

 By avoiding to annotate aggregations meant to be possibly pushed to an
 outer query until their references are resolved it is possible to
 aggregate over a query with the same alias.

 Even if #34176 is a convoluted case to support, this refactor seems
 worth it given the reduction in complexity it brings with regards to
 annotation removal when performing a subquery pushdown.
 }}}

-- 
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/01070184a5a5e45b-0804ef13-e758-4a44-9464-41cf556fcbd7-00%40eu-central-1.amazonses.com.


Re: [Django] #34173: SessionMiddleware support 503 status code

2022-11-23 Thread Django
#34173: SessionMiddleware support 503 status code
-+-
 Reporter:  SessionIssue |Owner:  Abhinav
 Type:   |  Yadav
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.sessions |  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by SessionIssue):

 Replying to [comment:5 Carlton Gibson]:
 > Happy to look at a patch (with tests) adjusting the check to `if
 response.status_code >= 500:`

 Is this a patch we can expect to see in 3.2 (LTS), or will this only be
 patched in the upcoming 4.2 LTS?
 Thanks in advance.

-- 
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/01070184a53bc591-8c120828-d48c-4ec8-a689-7c6ae8f62da6-00%40eu-central-1.amazonses.com.


Re: [Django] #34174: async process_exception being called as sync from async view/middleware

2022-11-23 Thread Django
#34174: async process_exception being called as sync from async view/middleware
-+-
 Reporter:  Gabriel Rado |Owner:  Gabriel
 Type:   |  Rado
  Cleanup/optimization   |   Status:  closed
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  middleware async | Triage Stage:  Accepted
  process_exception  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 OK, thanks for the follow-up. Do reopen if you're able to reduce it to an
 issue in Django.

-- 
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/01070184a4d917ed-5b2c885b-c24d-4bf0-b9a4-b8dc7cac75d3-00%40eu-central-1.amazonses.com.


Re: [Django] #34174: async process_exception being called as sync from async view/middleware

2022-11-23 Thread Django
#34174: async process_exception being called as sync from async view/middleware
-+-
 Reporter:  Gabriel Rado |Owner:  Gabriel
 Type:   |  Rado
  Cleanup/optimization   |   Status:  closed
Component:  Documentation|  Version:  4.1
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  middleware async | Triage Stage:  Accepted
  process_exception  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Gabriel Rado):

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


Comment:

 i tried to create a test to demonstrate this behavior and every try was
 successfull. thinking the problem could be another point of my project and
 not django itself, i'll close this ticket

-- 
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/01070184a4d17551-cc2d89f7-4b8c-4824-8f41-578bc9a9df01-00%40eu-central-1.amazonses.com.


Re: [Django] #34151: Adding explicit primary key with different type doesn't update related ManyToManyFields.

2022-11-23 Thread Django
#34151: Adding explicit primary key with different type doesn't update related
ManyToManyFields.
-+-
 Reporter:  STANISLAV LEPEKHOV   |Owner:  Bhuvnesh
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  4.1
 Severity:  Normal   |   Resolution:
 Keywords:  migrations pk uuid   | Triage Stage:  Accepted
  relation   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Aravind Swaminathan):

 Does this problem occur only while using a uuid field or even with other
 type fields as primary key?

-- 
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/01070184a4a94964-dbb8da01-28fd-49ba-b683-8cf4887a9128-00%40eu-central-1.amazonses.com.


Re: [Django] #32873: Deprecate USE_L10N setting.

2022-11-23 Thread Django
#32873: Deprecate USE_L10N setting.
-+-
 Reporter:  Carlton Gibson   |Owner:  Claude
 Type:   |  Paroz
  Cleanup/optimization   |   Status:  closed
Component:   |  Version:  dev
  Internationalization   |
 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 Carlton Gibson ):

 In [changeset:"3a46d5ec7971727bc54b9ecbab4f5b6885409557" 3a46d5ec]:
 {{{
 #!CommitTicketReference repository=""
 revision="3a46d5ec7971727bc54b9ecbab4f5b6885409557"
 [4.1.x] Refs #32873 -- Adjusted formatting note on USE_L10N default.

 Backport of 9582f2f9d173935fef35c8c27b0f80258b1fb106 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/01070184a48403c7-d5818acc-b8e9-4581-97df-920ff07903fe-00%40eu-central-1.amazonses.com.


Re: [Django] #32873: Deprecate USE_L10N setting.

2022-11-23 Thread Django
#32873: Deprecate USE_L10N setting.
-+-
 Reporter:  Carlton Gibson   |Owner:  Claude
 Type:   |  Paroz
  Cleanup/optimization   |   Status:  closed
Component:   |  Version:  dev
  Internationalization   |
 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 Carlton Gibson ):

 In [changeset:"9582f2f9d173935fef35c8c27b0f80258b1fb106" 9582f2f9]:
 {{{
 #!CommitTicketReference repository=""
 revision="9582f2f9d173935fef35c8c27b0f80258b1fb106"
 Refs #32873 -- Adjusted formatting note on USE_L10N default.
 }}}

-- 
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/01070184a483111e-ce4220b2-ab10-4802-bba0-e026ac604086-00%40eu-central-1.amazonses.com.


Re: [Django] #31679: Django subtly produces incorrect query when the same keyword appears in both aggregate() and annotate()

2022-11-23 Thread Django
#31679: Django subtly produces incorrect query when the same keyword appears in
both aggregate() and annotate()
-+-
 Reporter:  StefanosChaliasos|Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  3.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070184a471e6c3-ce92c007-98c1-4863-a04d-1db6c4331c64-00%40eu-central-1.amazonses.com.


Re: [Django] #34178: Prefetching a foreign key on GenericForeignKey results in incorrect queryset being selected

2022-11-23 Thread Django
#34178: Prefetching a foreign key on GenericForeignKey results in incorrect
queryset being selected
-+-
 Reporter:  Rohan Nahata |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  4.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  GenericForeignKey,   | Triage Stage:
  prefetch_related   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 > It silently does the wrong thing instead of erroring out.

 As far as I'm aware, raising an error would require fetching the content
 type for each instance which is inefficient and may cause a performance
 regression, see #21422.

-- 
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/01070184a3f816d5-ac210f3d-4220-4ed6-ac14-11147f62d4ab-00%40eu-central-1.amazonses.com.


Re: [Django] #34178: Prefetching a foreign key on GenericForeignKey results in incorrect queryset being selected

2022-11-23 Thread Django
#34178: Prefetching a foreign key on GenericForeignKey results in incorrect
queryset being selected
-+-
 Reporter:  Rohan Nahata |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  4.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  GenericForeignKey,   | Triage Stage:
  prefetch_related   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Rohan Nahata):

 Replying to [comment:2 Mariusz Felisiak]:
 > `QuerySet.prefetch_related()` works with `GenericForeignKey`, however it
 is only supported if the query is restricted to one `ContentType` (see
 `prefetch_related()`
 [https://docs.djangoproject.com/en/stable/ref/models/querysets/#prefetch-
 related docs]).
 >
 > Duplicate of #33651.

 Just a question regarding this. Wouldn't this be the wrong behaviour
 though? It silently does the wrong thing instead of erroring out.

-- 
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/01070184a3e4bf06-f869e6eb-c53b-469a-9685-8f880ff7eb09-00%40eu-central-1.amazonses.com.


Re: [Django] #33651: Support prefetch GenericForeignKey with custom queryset.

2022-11-23 Thread Django
#33651: Support prefetch GenericForeignKey with custom queryset.
-+-
 Reporter:  elonzh   |Owner:
 |  Gullapalli Saisurya Revanth
 Type:  New feature  |   Status:  assigned
Component:   |  Version:  4.0
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:  GenericForeignKey| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Todor Velichkov):

 Hi everyone, I took a brief look at the conversation in the pull request
 [https://github.com/django/django/pull/15636 #15636]  and I have a
 question about the issue being discussed there (passing list of querysets
 into an queryset argument).

 Is there anything specific about this, that is enforcing the use of a list
 of querysets? Is it possible to send as many `GenericPrefetch` objects as
 the number of querysets being required ? For example:
 {{{
 Node.objects.prefetch_related(
 GenericPrefetch("content_object", queryset=ItemA.objects.all()),
 GenericPrefetch("content_object", queryset=ItemB.objects.all()),
 )
 }}}
 this is in the spirit of the current `Prefetch` class, which actually
 allows you to prefetch multiple levels of objects, splitted into different
 prefetch calls. i.e:
 {{{
 Book.objects.prefetch_related(
 Prefetch("author", queryset=Author.objects.all()),
 Prefetch("author__house", queryset=House.objects.all()),
 )
 }}}
 And now I'm a little bit repeating myself with ticket [ticket:24272], but
 this could probably open the door for reusing `related_query_name` when
 there is a defined `GenericRelation` which could give us the following
 interface w/o using the generic `content_object` argument:
 {{{
 TaggedItem.objects.all().prefetch_related(
 GenericPrefetch('books',
 queryset=Book.objects.all().select_related('author')),
 GenericPrefetch('movies',
 queryset=Movie.objects.all().select_related('director')),
 )
 }}}

-- 
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/01070184a3d59c3a-c9910f24-45b6-45e2-86e6-9e86f7d8d483-00%40eu-central-1.amazonses.com.


Re: [Django] #34176: Annotation's original field-name can clash with result field name over aggregation

2022-11-23 Thread Django
#34176: Annotation's original field-name can clash with result field name over
aggregation
-+-
 Reporter:  Shai Berger  |Owner:  Simon
 |  Charette
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * 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/01070184a3cf089d-79e4f31b-6e6c-452c-9437-f81b4fcd1ec4-00%40eu-central-1.amazonses.com.


Re: [Django] #34110: Add InMemoryStorage

2022-11-23 Thread Django
#34110: Add InMemoryStorage
-+-
 Reporter:  Josh |Owner:  Francesco
 |  Panico
 Type:  New feature  |   Status:  assigned
Component:  File |  Version:  dev
  uploads/storage|
 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 Francesco Panico):

 * needs_better_patch:  1 => 0
 * needs_docs:  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/01070184a3bc0223-98bc925a-7fea-4490-8e93-3b2c30d2612c-00%40eu-central-1.amazonses.com.


Re: [Django] #33050: QuerySet.count() on combined queries with select_related() crashes on MySQL.

2022-11-23 Thread Django
#33050: QuerySet.count() on combined queries with select_related() crashes on
MySQL.
-+-
 Reporter:  Sunkyue  |Owner:  Jordan
 |  Bae
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  3.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  orm, count, union,   | Triage Stage:  Accepted
  select_related mysql   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"a411b909671b7b8f8773af6b7cffa6992fe29138" a411b909]:
 {{{
 #!CommitTicketReference repository=""
 revision="a411b909671b7b8f8773af6b7cffa6992fe29138"
 Refs #33050 -- Added test for QuerySet.count() on combined queries with
 select_related().

 Thanks Simon Charette for noticing this.

 Fixed in 70499b25c708557fb9ee2264686cd172f4b2354e.
 }}}

-- 
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/01070184a3a1b05c-dac9c9e2-41dc-4dc8-8752-16644ac0100e-00%40eu-central-1.amazonses.com.


Re: [Django] #33651: Support prefetch GenericForeignKey with custom queryset.

2022-11-23 Thread Django
#33651: Support prefetch GenericForeignKey with custom queryset.
-+-
 Reporter:  elonzh   |Owner:
 |  Gullapalli Saisurya Revanth
 Type:  New feature  |   Status:  assigned
Component:   |  Version:  4.0
  contrib.contenttypes   |
 Severity:  Normal   |   Resolution:
 Keywords:  GenericForeignKey| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Rohan Nahata):

 * cc: Rohan Nahata (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/01070184a387c0bd-506e173d-97f6-4279-90cd-b7386e923ff8-00%40eu-central-1.amazonses.com.