Re: [Django] #34533: OuterRef not resolved as part oh ORDER BY clause

2023-09-29 Thread Django
#34533: OuterRef not resolved as part oh ORDER BY clause
-+-
 Reporter:  REGNIER Guillaume|Owner:  Umang
 |  Patel
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  3.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  OuterRef, OrderBy| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Umang Patel):

 * has_patch:  0 => 1


Comment:

 https://github.com/django/django/pull/17326

-- 
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/0107018ae3ea2d6b-d697cf6d-d89a-4999-9346-095efd4c349c-00%40eu-central-1.amazonses.com.


Re: [Django] #34533: OuterRef not resolved as part oh ORDER BY clause

2023-09-29 Thread Django
#34533: OuterRef not resolved as part oh ORDER BY clause
-+-
 Reporter:  REGNIER Guillaume|Owner:  Umang
 |  Patel
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  3.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  OuterRef, OrderBy| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Umang Patel):

 * owner:  REGNIER Guillaume => Umang Patel


-- 
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/0107018ae3aea09d-1285cfe1-e91d-4022-a2e8-291565b2c83b-00%40eu-central-1.amazonses.com.


Re: [Django] #34884: Half bug/half enhancement : inconsistent behavior of get_or_create() regarding related attributes cache

2023-09-29 Thread Django
#34884: Half bug/half enhancement : inconsistent behavior of get_or_create()
regarding related attributes cache
-+-
 Reporter:  Laurent Lyaudet  |Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  ORM get_or_create| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Laurent Lyaudet):

 I coded a monkey patch for my use case where it will not be soon to
 upgrade Django and in case some bikeshedding occurs that puts to trash
 coherency and efficiency in yet another open source software where some
 people against free software have influence.
 Here it is :

 `get_or_create_monkey_patch.py`
 {{{
 from django.db.models import QuerySet, ForeignKey


 original_get_or_create = QuerySet.get_or_create


 def patched_get_or_create(self, defaults=None, **kwargs):
  result, created = original_get_or_create(self, defaults=defaults,
 **kwargs)
  if defaults is not None:
  for key, value in defaults.items():
  if isinstance(result._meta.get_field(key), ForeignKey):
  # isinstance handles OneToOneField also.
  setattr(result, key, value)
  for key, value in kwargs.items():
  if isinstance(result._meta.get_field(key), ForeignKey):
  # isinstance handles OneToOneField also.
  setattr(result, key, value)
  return result, created


 QuerySet.get_or_create = patched_get_or_create
 }}}

 You can execute it at the end of the previous script + some test and
 obtain this:


 {{{
 In [15]: from django.db.models import QuerySet, ForeignKey

 In [16]: original_get_or_create = QuerySet.get_or_create

 In [17]: def patched_get_or_create(self, defaults=None, **kwargs):
 ...:  result, created = original_get_or_create(self,
 defaults=defaults, **kwargs)
 ...:  if defaults is not None:
 ...:  for key, value in defaults.items():
 ...:  if isinstance(result._meta.get_field(key),
 ForeignKey):
 ...:  # isinstance handles OneToOneField also.
 ...:  setattr(result, key, value)
 ...:  for key, value in kwargs.items():
 ...:  if isinstance(result._meta.get_field(key), ForeignKey):
 ...:  # isinstance handles OneToOneField also.
 ...:  setattr(result, key, value)
 ...:  return result, created
 ...:

 In [18]: QuerySet.get_or_create = patched_get_or_create

 In [19]: permission, created =
 Permission.objects.get_or_create(name="Test", content_type=content_type,
 codename="Test")

 In [20]: created
 Out[20]: False

 In [21]: connection.queries
 Out[21]:
 [{'sql': "SELECT t.oid, typarray FROM pg_type t JOIN pg_namespace ns ON
 typnamespace = ns.oid WHERE typname = 'hstore'",
   'time': '0.001'},
  {'sql': "SELECT typarray FROM pg_type WHERE typname = 'citext'",
   'time': '0.000'},
  {'sql': 'SELECT "django_content_type"."id",
 "django_content_type"."app_label", "django_content_type"."model" FROM
 "django_content_type" WHERE ("django_content_type"."app_label" = \'auth\'
 AND "django_content_type"."model" = \'permission\')',
   'time': '0.001'},
  {'sql': 'SELECT "auth_permission"."id", "auth_permission"."name",
 "auth_permission"."content_type_id", "auth_permission"."codename" FROM
 "auth_permission" WHERE ("auth_permission"."codename" = \'Test\' AND
 "auth_permission"."content_type_id" = 2 AND "auth_permission"."name" =
 \'Test\')',
   'time': '0.001'},
  {'sql': 'INSERT INTO "auth_permission" ("name", "content_type_id",
 "codename") VALUES (\'Test\', 2, \'Test\') RETURNING
 "auth_permission"."id"',
   'time': '0.001'},
  {'sql': 'SELECT "auth_permission"."id", "auth_permission"."name",
 "auth_permission"."content_type_id", "auth_permission"."codename" FROM
 "auth_permission" WHERE ("auth_permission"."codename" = \'Test\' AND
 "auth_permission"."content_type_id" = 2 AND "auth_permission"."name" =
 \'Test\')',
   'time': '0.001'},
  {'sql': 'SELECT "django_content_type"."id",
 "django_content_type"."app_label", "django_content_type"."model" FROM
 "django_content_type" WHERE "django_content_type"."id" = 2',
   'time': '0.000'},
  {'sql': 'SELECT "auth_permission"."id", "auth_permission"."name",
 "auth_permission"."content_type_id", "auth_permission"."codename" FROM
 "auth_permission" WHERE ("auth_permission"."codename" = \'Test\' AND
 "auth_permission"."content_type_id" = 2 

Re: [Django] #25943: Auto Generated urls.py On startapp

2023-09-29 Thread Django
#25943: Auto Generated urls.py On startapp
-+-
 Reporter:  Chris Hedrick|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  urls.py startapp | Triage Stage:
  startproject   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 > Are +0 counted as in favor or not? :thinking:

 Check out https://docs.djangoproject.com/en/stable/internals/contributing
 /bugs-and-features/#how-we-make-decisions

-- 
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/0107018ae262ba57-3188879c-10f9-4826-a53d-79ab051e3765-00%40eu-central-1.amazonses.com.


Re: [Django] #25943: Auto Generated urls.py On startapp

2023-09-29 Thread Django
#25943: Auto Generated urls.py On startapp
-+-
 Reporter:  Chris Hedrick|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  urls.py startapp | Triage Stage:
  startproject   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Replying to [comment:6 Mariusz Felisiak]:
 > Replying to [comment:5 Natalia Bidart]:
 > > Replying to [comment:4 Mariusz Felisiak]:
 > > > Replying to [comment:2 Natalia Bidart]:
 > > > > Latest contributor discussion (seems to be reaching consensus):
 https://forum.djangoproject.com/t/updating-the-default-startapp-
 template/24193/7
 > > >
 > > > As far as I'm aware we are far from reaching a consensus. There is
 only one vote in favor.
 > >
 > > There are more votes in favor (Shai who approved the PR, and mine),
 and I think that Adam is also counting the previous conversations, he said
 ''I think we could cite past discussions as sufficient consensus.''
 >
 > I counted your "I'm not against it" as +0 (or 0), we have also 0 (I
 think) from Carlton, and -1 from me.
 >
 > > Shai who approved the PR
 >
 > Do you mean David?

 YES! Sorry :-)

 Are +0 counted as in favor or not? :thinking:

-- 
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/0107018ae26103e3-a3f86e5e-444b-4a7a-bca2-1c12bf9ea228-00%40eu-central-1.amazonses.com.


Re: [Django] #25943: Auto Generated urls.py On startapp

2023-09-29 Thread Django
#25943: Auto Generated urls.py On startapp
-+-
 Reporter:  Chris Hedrick|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  urls.py startapp | Triage Stage:
  startproject   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Replying to [comment:5 Natalia Bidart]:
 > Replying to [comment:4 Mariusz Felisiak]:
 > > Replying to [comment:2 Natalia Bidart]:
 > > > Latest contributor discussion (seems to be reaching consensus):
 https://forum.djangoproject.com/t/updating-the-default-startapp-
 template/24193/7
 > >
 > > As far as I'm aware we are far from reaching a consensus. There is
 only one vote in favor.
 >
 > There are more votes in favor (Shai who approved the PR, and mine), and
 I think that Adam is also counting the previous conversations, he said ''I
 think we could cite past discussions as sufficient consensus.''

 I counted your "I'm not against it" as +0 (or 0), we have also 0 (I think)
 from Carlton, and -1 from me.

 > Shai who approved the PR

 Do you mean David?

-- 
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/0107018ae25f11ac-90f00d43-68dd-4497-a3fb-fd5b0b993a81-00%40eu-central-1.amazonses.com.


Re: [Django] #25943: Auto Generated urls.py On startapp

2023-09-29 Thread Django
#25943: Auto Generated urls.py On startapp
-+-
 Reporter:  Chris Hedrick|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  urls.py startapp | Triage Stage:
  startproject   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Replying to [comment:4 Mariusz Felisiak]:
 > Replying to [comment:2 Natalia Bidart]:
 > > Latest contributor discussion (seems to be reaching consensus):
 https://forum.djangoproject.com/t/updating-the-default-startapp-
 template/24193/7
 >
 > As far as I'm aware we are far from reaching a consensus. There is only
 one vote in favor.

 There are more votes in favor (Shai who approved the PR, and mine), and I
 think that Adam is also counting the previous conversations, he said ''I
 think we could cite past discussions as sufficient consensus.''

-- 
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/0107018ae23533ce-4ad1f38d-17c5-4747-a980-c77282fbc945-00%40eu-central-1.amazonses.com.


Re: [Django] #34883: Allow template tags to set extra data on templates.

2023-09-29 Thread Django
#34883: Allow template tags to set extra data on templates.
-+-
 Reporter:  Carlton Gibson   |Owner:  Carlton
 |  Gibson
 Type:  New feature  |   Status:  assigned
Component:  Template system  |  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted


Comment:

 Seems reasonable.

-- 
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/0107018ae22c99f2-8f41b39e-5a19-405c-b4fc-9fc8ef7a6d7d-00%40eu-central-1.amazonses.com.


Re: [Django] #25943: Auto Generated urls.py On startapp

2023-09-29 Thread Django
#25943: Auto Generated urls.py On startapp
-+-
 Reporter:  Chris Hedrick|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  urls.py startapp | Triage Stage:
  startproject   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 Replying to [comment:2 Natalia Bidart]:
 > Latest contributor discussion (seems to be reaching consensus):
 https://forum.djangoproject.com/t/updating-the-default-startapp-
 template/24193/7

 As far as I'm aware we are far from reaching a consensus. There is only
 one vote in favor.

-- 
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/0107018ae22ad5c7-67b6bc8e-da9f-4921-9843-74ba05aea160-00%40eu-central-1.amazonses.com.


Re: [Django] #34883: Allow template tags to set extra data on templates.

2023-09-29 Thread Django
#34883: Allow template tags to set extra data on templates.
-+-
 Reporter:  Carlton Gibson   |Owner:  Carlton
 |  Gibson
 Type:  New feature  |   Status:  assigned
Component:  Template system  |  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * owner:  nobody => Carlton Gibson


-- 
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/0107018ae212fb41-927886f0-0179-42c8-bbac-5efa620cb80b-00%40eu-central-1.amazonses.com.


Re: [Django] #34883: Allow template tags to set extra data on templates.

2023-09-29 Thread Django
#34883: Allow template tags to set extra data on templates.
-+--
 Reporter:  Carlton Gibson   |Owner:  nobody
 Type:  New feature  |   Status:  assigned
Component:  Template system  |  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by Carlton Gibson):

 * has_patch:  0 => 1


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ae2084697-646dcd4d-117d-41cb-af37-007979f43fec-00%40eu-central-1.amazonses.com.


Re: [Django] #34883: Allow template tags to set extra data on templates.

2023-09-29 Thread Django
#34883: Allow template tags to set extra data on templates.
-+--
 Reporter:  Carlton Gibson   |Owner:  nobody
 Type:  New feature  |   Status:  assigned
Component:  Template system  |  Version:  5.0
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Carlton Gibson):

 [https://github.com/django/django/pull/17325 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/0107018ae2082242-6941ad68-5695-4cba-8320-c128f5646b0d-00%40eu-central-1.amazonses.com.


Re: [Django] #34881: migrate crashes when renaming model referenced twice by ManyToManyField.through model on SQLite.

2023-09-29 Thread Django
#34881: migrate crashes when renaming model referenced twice by
ManyToManyField.through model on SQLite.
+
 Reporter:  dennisvang  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  dev
 Severity:  Normal  |   Resolution:
 Keywords:  sqlite  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by dennisvang):

 Replying to [comment:10 Natalia Bidart]:
 > Assuming a simpler model for `Person` where the M2M is implicit, and
 doing the rename, does indeed work. The SQL for the migration is:
 > * 0003 (renamed `SimplerPerson` to `SimplerPersonFoo`)
 > {{{#!sql
 >
 > BEGIN;
 > --
 > -- Rename model SimplerPerson to SimplerPersonFoo
 > --
 > ALTER TABLE "ticket_34881_simplerperson" RENAME TO
 "ticket_34881_simplerpersonfoo";
 > CREATE TABLE "ticket_34881_simplerpersonfoo_parents_or_children" ("id"
 integer NOT NULL PRIMARY KEY AUTOINCREMENT, "from_simplerpersonfoo_id"
 bigint NOT NULL REFERENCES "ticket_34881_simplerpersonfoo" ("id")
 DEFERRABLE INITIALLY DEFERRED, "to_simplerpersonfoo_id" bigint NOT NULL
 REFERENCES "ticket_34881_simplerpersonfoo" ("id") DEFERRABLE INITIALLY
 DEFERRED);
 > INSERT INTO "ticket_34881_simplerpersonfoo_parents_or_children" (id,
 from_simplerpersonfoo_id, to_simplerpersonfoo_id) SELECT id,
 from_simplerperson_id, to_simplerperson_id FROM
 "ticket_34881_simplerperson_parents_or_children";
 > DROP TABLE "ticket_34881_simplerperson_parents_or_children";
 > CREATE UNIQUE INDEX
 
"ticket_34881_simplerpersonfoo_parents_or_children_from_simplerpersonfoo_id_to_simplerpersonfoo_id_f05f0b12_uniq"
 ON "ticket_34881_simplerpersonfoo_parents_or_children"
 ("from_simplerpersonfoo_id", "to_simplerpersonfoo_id");
 > CREATE INDEX
 
"ticket_34881_simplerpersonfoo_parents_or_children_from_simplerpersonfoo_id_6d3cdfb4"
 ON "ticket_34881_simplerpersonfoo_parents_or_children"
 ("from_simplerpersonfoo_id");
 > CREATE INDEX
 
"ticket_34881_simplerpersonfoo_parents_or_children_to_simplerpersonfoo_id_83aff647"
 ON "ticket_34881_simplerpersonfoo_parents_or_children"
 ("to_simplerpersonfoo_id");
 > COMMIT;
 > }}}
 >
 > It's worth noting that the content of the explicit M2M (`Relation`) has
 these rows:
 > {{{
 > sqlite> SELECT * FROM ticket_34881_relation;
 > 1|1|3
 > 2|2|3
 > 3|1|4
 > 4|2|4
 > }}}
 >
 > While the rows for the implicit one include:
 > {{{
 > sqlite> SELECT * FROM ticket_34881_simplerperson_parents_or_children;
 > 1|3|1
 > 2|3|2
 > 3|1|3
 > 4|2|3
 > 5|4|1
 > 6|4|2
 > 7|1|4
 > 8|2|4
 > }}}
 >
 >
 > It may look like a valid issue but I'll cc Simon and Mariusz for a
 second opinion.

 Thanks for reproducing this. :-)

 You are right, for the implicit M2M relation, I should have set
 `symmetrical=False` in order to get the equivalent of my explicit
 `Relation`.

 However, the rename also works fine for the implicit case with
 `symmetrical=False`.

-- 
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/0107018ae207c497-8059ff2e-a20d-4aed-987b-f64ac45aaa28-00%40eu-central-1.amazonses.com.


[Django] #34884: Half bug/half enhancement : inconsistent behavior of get_or_create() regarding related attributes cache

2023-09-29 Thread Django
#34884: Half bug/half enhancement : inconsistent behavior of get_or_create()
regarding related attributes cache
-+-
   Reporter:  LLyaudet   |  Owner:  nobody
   Type: | Status:  new
  Uncategorized  |
  Component:  Database   |Version:  dev
  layer (models, ORM)|
   Severity:  Normal |   Keywords:  ORM get_or_create
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Hello,
 The sample script below demonstrates that get_or_create() avoid
 unnecessary DB query for related object given as argument only if created
 is True.
 It would be nice if the case created is False could be made coherent with
 it.
 Setting the cache when possible would avoid having to do all over the
 code:

 {{{
 my_object = MyModel.objects.get_or_create(related_object=related_object)
 my_object.related_object = related_object
 }}}


 I can code a patch and provide it in a few days if my idea is accepted :)
 Here is the script:


 {{{
 In [1]: from django.db import connection

 In [2]: from django.contrib.contenttypes.models import ContentType

 In [3]: from django.contrib.auth.models import Permission

 In [4]: content_type = ContentType.objects.get_for_model(Permission)

 In [5]: permission, created =
 Permission.objects.get_or_create(name="Test", content_type=content_type,
 codename="Test")

 In [6]: created
 Out[6]: True

 In [7]: connection.queries
 Out[7]:
 [{'sql': "SELECT t.oid, typarray FROM pg_type t JOIN pg_namespace ns ON
 typnamespace = ns.oid WHERE typname = 'hstore'",
   'time': '0.001'},
  {'sql': "SELECT typarray FROM pg_type WHERE typname = 'citext'",
   'time': '0.000'},
  {'sql': 'SELECT "django_content_type"."id",
 "django_content_type"."app_label", "django_content_type"."model" FROM
 "django_content_type" WHERE ("django_content_type"."app_label" = \'auth\'
 AND "django_content_type"."model" = \'permission\')',
   'time': '0.001'},
  {'sql': 'SELECT "auth_permission"."id", "auth_permission"."name",
 "auth_permission"."content_type_id", "auth_permission"."codename" FROM
 "auth_permission" WHERE ("auth_permission"."codename" = \'Test\' AND
 "auth_permission"."content_type_id" = 2 AND "auth_permission"."name" =
 \'Test\')',
   'time': '0.001'},
  {'sql': 'INSERT INTO "auth_permission" ("name", "content_type_id",
 "codename") VALUES (\'Test\', 2, \'Test\') RETURNING
 "auth_permission"."id"',
   'time': '0.001'}]

 In [8]: permission.content_type
 Out[8]: 

 In [9]: connection.queries
 Out[9]:
 [{'sql': "SELECT t.oid, typarray FROM pg_type t JOIN pg_namespace ns ON
 typnamespace = ns.oid WHERE typname = 'hstore'",
   'time': '0.001'},
  {'sql': "SELECT typarray FROM pg_type WHERE typname = 'citext'",
   'time': '0.000'},
  {'sql': 'SELECT "django_content_type"."id",
 "django_content_type"."app_label", "django_content_type"."model" FROM
 "django_content_type" WHERE ("django_content_type"."app_label" = \'auth\'
 AND "django_content_type"."model" = \'permission\')',
   'time': '0.001'},
  {'sql': 'SELECT "auth_permission"."id", "auth_permission"."name",
 "auth_permission"."content_type_id", "auth_permission"."codename" FROM
 "auth_permission" WHERE ("auth_permission"."codename" = \'Test\' AND
 "auth_permission"."content_type_id" = 2 AND "auth_permission"."name" =
 \'Test\')',
   'time': '0.001'},
  {'sql': 'INSERT INTO "auth_permission" ("name", "content_type_id",
 "codename") VALUES (\'Test\', 2, \'Test\') RETURNING
 "auth_permission"."id"',
   'time': '0.001'}]

 In [10]: permission, created =
 Permission.objects.get_or_create(name="Test", content_type=content_type,
 codename="Test")

 In [11]: created
 Out[11]: False

 In [12]: connection.queries
 Out[12]:
 [{'sql': "SELECT t.oid, typarray FROM pg_type t JOIN pg_namespace ns ON
 typnamespace = ns.oid WHERE typname = 'hstore'",
   'time': '0.001'},
  {'sql': "SELECT typarray FROM pg_type WHERE typname = 'citext'",
   'time': '0.000'},
  {'sql': 'SELECT "django_content_type"."id",
 "django_content_type"."app_label", "django_content_type"."model" FROM
 "django_content_type" WHERE ("django_content_type"."app_label" = \'auth\'
 AND "django_content_type"."model" = \'permission\')',
   'time': '0.001'},
  {'sql': 'SELECT "auth_permission"."id", "auth_permission"."name",
 "auth_permission"."content_type_id", "auth_permission"."codename" FROM
 "auth_permission" WHERE ("auth_permission"."codename" = \'Test\' AND
 "auth_permission"."content_type_id" = 2 AND "auth_permission"."name" =
 \'Test\')',
   'time': '0.001'},
  {'sql': 'INSERT INTO "auth_permission" ("name", "content_type_id",
 "codename") VALUES (\'T

[Django] #34883: Allow template tags to set extra data on templates.

2023-09-29 Thread Django
#34883: Allow template tags to set extra data on templates.
---+--
   Reporter:  Carlton Gibson   |  Owner:  nobody
   Type:  New feature  | Status:  assigned
  Component:  Template system  |Version:  5.0
   Severity:  Normal   |   Keywords:
   Triage Stage:  Unreviewed   |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+--
 Custom template tags may need to pass additional data, beyond the node
 list, out of the parsing context, for later use, by (e.g.) the template
 loader, or other template clients.

 Currently this is only feasible by attaching data to the `origin` object,
 since that's the only object available to both the template and the
 parser, but this isn't pretty.

 I propose adding an additional attribute to the `Parser` that can be used
 by template tag authors to have extra data set on the template instance,
 that can then be used as needed.

 This ticket comes from the forum discussion on
 [https://forum.djangoproject.com/t/adding-template-fragments-or-partials-
 for-the-dtl/21500 Adding template fragments or partials for the DTL] — it
 is the necessary minimal first change to allow an official[*] API such
 that a library such as `django-template-partials` can pass named node
 lists out of the parser for later use. (I'd imagine it would be useful to
 other tag library authors once in play.)

 [*]: I say official, but I'm not sure whether to make this public — i.e.
 documented — it's pretty niche — those who need it'll find it. I'd be
 happy with a regression test making sure it didn't break but leaving it
 undocumented beyond that. Opinions welcome. 🙂

-- 
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/0107018ae204a738-7538be08-6270-4a41-8c6d-9e4ab849fcba-00%40eu-central-1.amazonses.com.


Re: [Django] #25943: Auto Generated urls.py On startapp

2023-09-29 Thread Django
#25943: Auto Generated urls.py On startapp
-+-
 Reporter:  Chris Hedrick|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  urls.py startapp | Triage Stage:
  startproject   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * version:  1.9 => dev
 * easy:  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/0107018ae1f445e3-96f570f8-cc01-4a7b-9a0c-887a89e99dc7-00%40eu-central-1.amazonses.com.


Re: [Django] #25943: Auto Generated urls.py On startapp

2023-09-29 Thread Django
#25943: Auto Generated urls.py On startapp
-+-
 Reporter:  Chris Hedrick|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  1.9
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  urls.py startapp | Triage Stage:
  startproject   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Latest contributor discussion (seems to be reaching consensus):
 https://forum.djangoproject.com/t/updating-the-default-startapp-
 template/24193/7

-- 
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/0107018ae1f41caa-47e6730d-8749-4f31-8d74-0df6f0866967-00%40eu-central-1.amazonses.com.


Re: [Django] #28307: Add more stub files in startapp template

2023-09-29 Thread Django
#28307: Add more stub files in startapp template
-+-
 Reporter:  Mark |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  dev
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Natalia Bidart):

 Related to ticket #25943

-- 
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/0107018ae1dbfc83-eda06297-44d2-49c3-88de-0bc2af22fc29-00%40eu-central-1.amazonses.com.


Re: [Django] #33113: Add example to documentation of a DateInput with input_type='date'

2023-09-29 Thread Django
#33113: Add example to documentation of a DateInput with input_type='date'
-+-
 Reporter:  dennisvang   |Owner:
 Type:   |  dennisvang
  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:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Natalia Bidart):

 * version:  3.2 => dev


-- 
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/0107018ae1056063-0b35b8e5-b518-4a5d-bc8a-a3b6dafae2e0-00%40eu-central-1.amazonses.com.


Re: [Django] #33113: Add example to documentation of a DateInput with input_type='date'

2023-09-29 Thread Django
#33113: Add example to documentation of a DateInput with input_type='date'
-+-
 Reporter:  dennisvang   |Owner:
 Type:   |  dennisvang
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  3.2
 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
-+-

Comment (by Natalia Bidart):

 Pinged PR author to see if we can revive this effort (following recent
 ticket #34853).

-- 
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/0107018ae104f2f2-9a91ac34-7788-4b03-8070-37c86b999bbd-00%40eu-central-1.amazonses.com.


Re: [Django] #34853: Accept-Language Header takes precedence over cookie for format localization

2023-09-29 Thread Django
#34853: Accept-Language Header takes precedence over cookie for format 
localization
-+-
 Reporter:  blue-hexagon |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:   |  Version:  dev
  Internationalization   |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  l10n format  | Triage Stage:  Accepted
  localization   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  1
-+-

Comment (by Natalia Bidart):

 Replying to [comment:14 Claude Paroz]:
 > I had a look at your issue. This is an issue with the `` widgets. And this is exactly why Django doesn't use
 `type="date"` by default. With those inputs, browsers are forcing their
 content to the format of the current active browser locale, whatever the
 language of the page language. So Django cannot do anything to change
 that.
 >
 > Read the last comment of #34660 and the tickets/discussion it
 references.

 Thank you Claude, I missed the override for the widget's type attr. TIL
 many things regarding this topic!

-- 
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/0107018ae0d33303-28e9eaac-17b3-4192-ac5e-e5c856564667-00%40eu-central-1.amazonses.com.


Re: [Django] #34657: Testing assertions `assertContains` and `assertInHTML` should output the haystack on failure

2023-09-29 Thread Django
#34657: Testing assertions `assertContains` and `assertInHTML` should output the
haystack on failure
-+-
 Reporter:  Thibaud Colas|Owner:  Chinmoy
 Type:  New feature  |   Status:  assigned
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  HTML, assertions,| Triage Stage:  Accepted
  testing|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ae0228063-d10b1b42-7463-4512-bb13-56939a3abee5-00%40eu-central-1.amazonses.com.


Re: [Django] #34657: Testing assertions `assertContains` and `assertInHTML` should output the haystack on failure

2023-09-29 Thread Django
#34657: Testing assertions `assertContains` and `assertInHTML` should output the
haystack on failure
-+-
 Reporter:  Thibaud Colas|Owner:  Chinmoy
 Type:  New feature  |   Status:  assigned
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  HTML, assertions,| Triage Stage:  Accepted
  testing|
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:"e99c7d8847e9006f877ab3cea47f1977652af71f" e99c7d88]:
 {{{
 #!CommitTicketReference repository=""
 revision="e99c7d8847e9006f877ab3cea47f1977652af71f"
 Refs #34657 -- Made assertInHTML() use unparsed needle in error messages.
 }}}

-- 
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/0107018ae0218722-f1e3b74c-0b7f-4b33-8895-50619301fb5d-00%40eu-central-1.amazonses.com.


Re: [Django] #34882: options=0 is not respected when calling AsGeoJSON()

2023-09-29 Thread Django
#34882: options=0 is not respected when calling AsGeoJSON()
+
 Reporter:  3nids   |Owner:  3nids
 Type:  Bug |   Status:  assigned
Component:  GIS |  Version:  4.2
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by 3nids):

 https://github.com/django/django/pull/17320

-- 
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/0107018adff64004-45422554-4000-43c5-8d3a-5b38d06d8e67-00%40eu-central-1.amazonses.com.


Re: [Django] #34882: options=0 is not respected when calling AsGeoJSON() (was: Options are not respected when calling contrib.gis.db.models.functions.AsGeoJSON)

2023-09-29 Thread Django
#34882: options=0 is not respected when calling AsGeoJSON()
+
 Reporter:  3nids   |Owner:  3nids
 Type:  Bug |   Status:  assigned
Component:  GIS |  Version:  4.2
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by Mariusz Felisiak):

 * status:  new => assigned
 * component:  Uncategorized => GIS
 * needs_tests:  0 => 1
 * owner:  nobody => 3nids
 * has_patch:  0 => 1
 * type:  Uncategorized => Bug
 * stage:  Unreviewed => Accepted


Comment:

 Good catch. Please add a regression test.

 [https://github.com/django/django/pull/17320 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/0107018adff5d810-99211def-a6cd-48f8-b1fe-224b2acba9d2-00%40eu-central-1.amazonses.com.


[Django] #34882: Options are not respected when calling contrib.gis.db.models.functions.AsGeoJSON

2023-09-29 Thread Django
#34882: Options are not respected when calling
contrib.gis.db.models.functions.AsGeoJSON
-+
   Reporter:  3nids  |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Uncategorized  |Version:  4.2
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 When calling AssGeoJSON, if `bbox` and `crs` are both `false`, then
 `options = 0`, there fore not added to the expression. See [0].

 In Postgis [1], with geometries, the default is not 0 but 8, meaning the
 CRS is returned, not respecting the original call arguments.


 [0]
 
https://github.com/django/django/blob/6ad0dbc8d90ef37731608f7ac3d6e1d62cc8c765/django/contrib/gis/db/models/functions.py#L198
 [1] https://postgis.net/docs/ST_AsGeoJSON.html

-- 
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/0107018adfe3945c-ff5901c4-14d6-4ce3-9066-50d2d7fb6bd7-00%40eu-central-1.amazonses.com.


Re: [Django] #32602: Clarify wording re: parallel testing and test case vs. test case class

2023-09-29 Thread Django
#32602: Clarify wording re: parallel testing and test case vs. test case class
-+-
 Reporter:  Chris Jerdonek   |Owner:  Faishal
 Type:   |  Manzar
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  3.1
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 [https://github.com/django/django/pull/17319 New 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/0107018adfcc5d3e-7716153d-625a-446e-89f9-cb851ee662f2-00%40eu-central-1.amazonses.com.