Re: [Django] #34816: GenericForeignKey crashes if content_type_id is changed and object_id is type incompatible with old object

2023-09-07 Thread Django
#34816: GenericForeignKey crashes if content_type_id is changed and object_id is
type incompatible with old object
-+-
 Reporter:  Richard Laager   |Owner:  Oguzhan
 |  Akan
 Type:  Bug  |   Status:  closed
Component:   |  Version:  4.2
  contrib.contenttypes   |
 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 GitHub ):

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


Comment:

 In [changeset:"e41f9f94505f690525f16af8bd10e62e22bc0207" e41f9f94]:
 {{{
 #!CommitTicketReference repository=""
 revision="e41f9f94505f690525f16af8bd10e62e22bc0207"
 Fixed #34816 -- Fixed GenericForeignKey crash when checking cache for
 primary keys with different types.
 }}}

-- 
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/0107018a738b82d1-270c106a-e1fb-40e4-96e8-9ced23b68420-00%40eu-central-1.amazonses.com.


Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
 Reporter:  RelaxedDong  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 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 Mariusz Felisiak):

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


Comment:

 `ForeignObject` is an abstraction level, not a proper model field. You
 should use `models.ForeignKey`. If you're having trouble understanding how
 Django works, see TicketClosingReasons/UseSupportChannels for ways to get
 help.

-- 
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/0107018a738a28e2-3bdcbbdb-5fcf-4d9c-8d6b-0245210b4731-00%40eu-central-1.amazonses.com.


Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
 Reporter:  puc_dong |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 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
-+-

Comment (by puc_dong):

 {{{
 (simpleui) ☁  test_migations  python manage.py makemigrations
 System check identified some issues:

 WARNINGS:
 app_1.Model1: (models.W042) Auto-created primary key used when not
 defining a primary key type, by default 'django.db.models.AutoField'.
 HINT: Configure the DEFAULT_AUTO_FIELD setting or the
 App1Config.default_auto_field attribute to point to a subclass of
 AutoField, e.g. 'django.db.models.BigAutoField'.
 app_2.Model2: (models.W042) Auto-created primary key used when not
 defining a primary key type, by default 'django.db.models.AutoField'.
 HINT: Configure the DEFAULT_AUTO_FIELD setting or the
 App2Config.default_auto_field attribute to point to a subclass of
 AutoField, e.g. 'django.db.models.BigAutoField'.
 Migrations for 'app_1':
   app_1/migrations/0001_initial.py
 - Create model Model1
 Migrations for 'app_2':
   app_2/migrations/0001_initial.py
 - Create model Model2
 (simpleui) ☁  test_migations  python manage.py migrate
 System check identified some issues:

 WARNINGS:
 app_1.Model1: (models.W042) Auto-created primary key used when not
 defining a primary key type, by default 'django.db.models.AutoField'.
 HINT: Configure the DEFAULT_AUTO_FIELD setting or the
 App1Config.default_auto_field attribute to point to a subclass of
 AutoField, e.g. 'django.db.models.BigAutoField'.
 app_2.Model2: (models.W042) Auto-created primary key used when not
 defining a primary key type, by default 'django.db.models.AutoField'.
 HINT: Configure the DEFAULT_AUTO_FIELD setting or the
 App2Config.default_auto_field attribute to point to a subclass of
 AutoField, e.g. 'django.db.models.BigAutoField'.
 Operations to perform:
   Apply all migrations: admin, app_1, app_2, auth, contenttypes, sessions
 Running migrations:
   Applying contenttypes.0001_initial... OK
   Applying auth.0001_initial... OK
   Applying admin.0001_initial... OK
   Applying admin.0002_logentry_remove_auto_add... OK
   Applying admin.0003_logentry_add_action_flag_choices... OK
   Applying app_1.0001_initial... OK
   Applying app_2.0001_initial... OK
   Applying contenttypes.0002_remove_content_type_name... OK
   Applying auth.0002_alter_permission_name_max_length... OK
   Applying auth.0003_alter_user_email_max_length... OK
   Applying auth.0004_alter_user_username_opts... OK
   Applying auth.0005_alter_user_last_login_null... OK
   Applying auth.0006_require_contenttypes_0002... OK
   Applying auth.0007_alter_validators_add_error_messages... OK
   Applying auth.0008_alter_user_username_max_length... OK
   Applying auth.0009_alter_user_last_name_max_length... OK
   Applying auth.0010_alter_group_name_max_length... OK
   Applying auth.0011_update_proxy_permissions... OK
   Applying auth.0012_alter_user_first_name_max_length... OK
   Applying sessions.0001_initial... OK

 **Add blank=True to the scenes field of Model2**

 (simpleui) ☁  test_migations  python manage.py makemigrations
 System check identified some issues:

 WARNINGS:
 app_1.Model1: (models.W042) Auto-created primary key used when not
 defining a primary key type, by default 'django.db.models.AutoField'.
 HINT: Configure the DEFAULT_AUTO_FIELD setting or the
 App1Config.default_auto_field attribute to point to a subclass of
 AutoField, e.g. 'django.db.models.BigAutoField'.
 app_2.Model2: (models.W042) Auto-created primary key used when not
 defining a primary key type, by default 'django.db.models.AutoField'.
 HINT: Configure the DEFAULT_AUTO_FIELD setting or the
 App2Config.default_auto_field attribute to point to a subclass of
 AutoField, e.g. 'django.db.models.BigAutoField'.
 Migrations for 'app_2':
   app_2/migrations/0002_alter_model2_scenes.py
 - Alter field scenes on model2

 (simpleui) ☁  test_migations  python manage.py migrate
 System check identified some issues:

 WARNINGS:
 app_1.Model1: (models.W042) Auto-created primary key used when not
 defining a primary key type, by default 'django.db.models.AutoField'.
 HINT: Configure the DEFAULT_AUTO_FIELD setting or the
 App1Config.d

Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
 Reporter:  RelaxedDong  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 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
-+-

Comment (by RelaxedDong):

 Replying to [comment:3 Mariusz Felisiak]:
 > I'm not sure how to you reach a field without a `column` in migrations.
 I don't think you've explained the issue in enough detail to confirm a bug
 in Django, can you provide a sample project or test case that reproduces
 the issue?

 I submitted my case code and process

-- 
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/0107018a738057eb-1250b473-c8d6-4640-bf98-65946774ba1e-00%40eu-central-1.amazonses.com.


Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
 Reporter:  RelaxedDong  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 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 RelaxedDong):

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


-- 
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/0107018a737e8537-5bc1b963-35c7-424a-8bd2-f09b8c8618a3-00%40eu-central-1.amazonses.com.


Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
 Reporter:  puc_dong |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  needsinfo
 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 puc_dong):

 * component:  Migrations => Database layer (models, ORM)
 * needs_tests:  1 => 0


Old description:

> Execute migrate to report an error
>
> If the models.ForeignObject attribute is used, changing null or blank to
> generate a new migration record will result in an error message when
> executing the migrate again
>

>
> {{{
> File "/Users/donghao/test/test_migations/manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/__init__.py", line 442, in
> execute_from_command_line
> utility.execute()
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/__init__.py", line 436, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 412, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 458, in execute
> output = self.handle(*args, **options)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 106, in wrapper
> res = handle_func(*args, **kwargs)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/commands/migrate.py", line 356, in handle
> post_migrate_state = executor.migrate(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 135, in migrate
> state = self._migrate_all_forwards(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 167, in
> _migrate_all_forwards
> state = self.apply_migration(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 252, in apply_migration
> state = migration.apply(state, schema_editor)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/migration.py", line 132, in apply
> operation.database_forwards(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/operations/fields.py", line 235, in
> database_forwards
> schema_editor.alter_field(from_model, from_field, to_field)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 785, in alter_field
> if not self._field_should_be_altered(old_field, new_field):
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 1530, in
> _field_should_be_altered
> return self.quote_name(old_field.column) != self.quote_name(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 204, in quote_name
> return self.connection.ops.quote_name(name)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/mysql/operations.py", line 184, in quote_name
> if name.startswith("`") and name.endswith("`"):
> AttributeError: 'NoneType' object has no attribute 'startswith'
> }}}
>

> https://github.com/django/django/pull/17235

New description:

 Execute migrate to report an error

 If the models.ForeignObject attribute is used, changing null or blank to
 generate a new migration record will result in an error message when
 executing the migrate again

 {{{
 File "/Users/donghao/test/test_migations/manage.py", line 22, in 
 execute_from_command_line(sys.argv)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 442, in
 execute_from_command_line
 utility.execute()
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 436, in e

Re: [Django] #34816: GenericForeignKey crashes if content_type_id is changed and object_id is type incompatible with old object

2023-09-07 Thread Django
#34816: GenericForeignKey crashes if content_type_id is changed and object_id is
type incompatible with old object
-+-
 Reporter:  Richard Laager   |Owner:  Oguzhan
 |  Akan
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  4.2
  contrib.contenttypes   |
 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/0107018a7377790e-4cfa09cd-7d42-4c53-8e61-077afd4df12f-00%40eu-central-1.amazonses.com.


Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+--
 Reporter:  RelaxedDong  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  4.2
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:   | Triage Stage:  Unreviewed
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 => closed
 * resolution:   => needsinfo
 * component:  Database layer (models, ORM) => Migrations
 * needs_tests:  0 => 1


Comment:

 I'm not sure how to you reach a field without a `column` in migrations. I
 don't think you've explained the issue in enough detail to confirm a bug
 in Django, can you provide a sample project or test case that reproduces
 the issue?

-- 
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/0107018a736beb16-ac31d096-aa61-44d0-ad34-76c30a4f6816-00%40eu-central-1.amazonses.com.


Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
 Reporter:  RelaxedDong  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 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
-+-
Description changed by RelaxedDong:

Old description:

> Execute migrate to report an error
>
> If the models.ForeignObject attribute is used, changing null or blank to
> generate a new migration record will result in an error message when
> executing the migrate again
>

>
> {{{
> File "/Users/donghao/test/test_migations/manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/__init__.py", line 442, in
> execute_from_command_line
> utility.execute()
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/__init__.py", line 436, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 412, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 458, in execute
> output = self.handle(*args, **options)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 106, in wrapper
> res = handle_func(*args, **kwargs)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/commands/migrate.py", line 356, in handle
> post_migrate_state = executor.migrate(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 135, in migrate
> state = self._migrate_all_forwards(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 167, in
> _migrate_all_forwards
> state = self.apply_migration(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 252, in apply_migration
> state = migration.apply(state, schema_editor)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/migration.py", line 132, in apply
> operation.database_forwards(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/operations/fields.py", line 235, in
> database_forwards
> schema_editor.alter_field(from_model, from_field, to_field)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 785, in alter_field
> if not self._field_should_be_altered(old_field, new_field):
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 1530, in
> _field_should_be_altered
> return self.quote_name(old_field.column) != self.quote_name(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 204, in quote_name
> return self.connection.ops.quote_name(name)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/mysql/operations.py", line 184, in quote_name
> if name.startswith("`") and name.endswith("`"):
> AttributeError: 'NoneType' object has no attribute 'startswith'
> }}}

New description:

 Execute migrate to report an error

 If the models.ForeignObject attribute is used, changing null or blank to
 generate a new migration record will result in an error message when
 executing the migrate again



 {{{
 File "/Users/donghao/test/test_migations/manage.py", line 22, in 
 execute_from_command_line(sys.argv)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 442, in
 execute_from_command_line
 utility.execute()
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 436, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site

Re: [Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
 Reporter:  RelaxedDong  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 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
-+-
Description changed by RelaxedDong:

Old description:

> … execute migrate to report an error
>
> If the models.ForeignObject attribute is used, changing null or blank to
> generate a new migration record will result in an error message when
> executing the migrate again
>
> ```
>   File "/Users/donghao/test/test_migations/manage.py", line 22, in
> 
> execute_from_command_line(sys.argv)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/__init__.py", line 442, in
> execute_from_command_line
> utility.execute()
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/__init__.py", line 436, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 412, in run_from_argv
> self.execute(*args, **cmd_options)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 458, in execute
> output = self.handle(*args, **options)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/base.py", line 106, in wrapper
> res = handle_func(*args, **kwargs)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/core/management/commands/migrate.py", line 356, in handle
> post_migrate_state = executor.migrate(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 135, in migrate
> state = self._migrate_all_forwards(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 167, in
> _migrate_all_forwards
> state = self.apply_migration(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/executor.py", line 252, in apply_migration
> state = migration.apply(state, schema_editor)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/migration.py", line 132, in apply
> operation.database_forwards(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/migrations/operations/fields.py", line 235, in
> database_forwards
> schema_editor.alter_field(from_model, from_field, to_field)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 785, in alter_field
> if not self._field_should_be_altered(old_field, new_field):
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 1530, in
> _field_should_be_altered
> return self.quote_name(old_field.column) != self.quote_name(
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/base/schema.py", line 204, in quote_name
> return self.connection.ops.quote_name(name)
>   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
> packages/django/db/backends/mysql/operations.py", line 184, in quote_name
> if name.startswith("`") and name.endswith("`"):
> AttributeError: 'NoneType' object has no attribute 'startswith'
> ```
>
> A pre judgment has been added here to avoid this issue

New description:

 Execute migrate to report an error

 If the models.ForeignObject attribute is used, changing null or blank to
 generate a new migration record will result in an error message when
 executing the migrate again



 {{{
 File "/Users/donghao/test/test_migations/manage.py", line 22, in 
 execute_from_command_line(sys.argv)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 442, in
 execute_from_command_line
 utility.execute()
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 436, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
  

[Django] #34820: Change the properties of ForeignObject object, such as blank, null, and execute migrate to report an error

2023-09-07 Thread Django
#34820: Change the properties of ForeignObject object, such as blank, null, and
execute migrate to report an error
-+-
   Reporter: |  Owner:  nobody
  RelaxedDong|
   Type:  Bug| Status:  new
  Component:  Database   |Version:  4.2
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  1
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 … execute migrate to report an error

 If the models.ForeignObject attribute is used, changing null or blank to
 generate a new migration record will result in an error message when
 executing the migrate again

 ```
   File "/Users/donghao/test/test_migations/manage.py", line 22, in
 
 execute_from_command_line(sys.argv)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 442, in
 execute_from_command_line
 utility.execute()
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/__init__.py", line 436, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/base.py", line 412, in run_from_argv
 self.execute(*args, **cmd_options)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/base.py", line 458, in execute
 output = self.handle(*args, **options)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/base.py", line 106, in wrapper
 res = handle_func(*args, **kwargs)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/core/management/commands/migrate.py", line 356, in handle
 post_migrate_state = executor.migrate(
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/migrations/executor.py", line 135, in migrate
 state = self._migrate_all_forwards(
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/migrations/executor.py", line 167, in
 _migrate_all_forwards
 state = self.apply_migration(
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/migrations/executor.py", line 252, in apply_migration
 state = migration.apply(state, schema_editor)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/migrations/migration.py", line 132, in apply
 operation.database_forwards(
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/migrations/operations/fields.py", line 235, in
 database_forwards
 schema_editor.alter_field(from_model, from_field, to_field)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/backends/base/schema.py", line 785, in alter_field
 if not self._field_should_be_altered(old_field, new_field):
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/backends/base/schema.py", line 1530, in
 _field_should_be_altered
 return self.quote_name(old_field.column) != self.quote_name(
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/backends/base/schema.py", line 204, in quote_name
 return self.connection.ops.quote_name(name)
   File "/Users/donghao/.virtualenvs/simpleui/lib/python3.9/site-
 packages/django/db/backends/mysql/operations.py", line 184, in quote_name
 if name.startswith("`") and name.endswith("`"):
 AttributeError: 'NoneType' object has no attribute 'startswith'
 ```

 A pre judgment has been added here to avoid this issue

-- 
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/0107018a735b4dfb-4e1724b5-6e8e-445b-96db-56b6a63975bc-00%40eu-central-1.amazonses.com.


Re: [Django] #34819: GenericForeignKey.get_prefetch_queryset()

2023-09-07 Thread Django
#34819: GenericForeignKey.get_prefetch_queryset()
--+
 Reporter:  Richard Laager|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.contenttypes  |  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
--+
Changes (by Mariusz Felisiak):

 * has_patch:  1 => 0
 * stage:  Unreviewed => Accepted


Comment:

 Thanks , sounds valid. Would you like to prepare a patch (via GitHub PR)?
 a regression test is needed.

-- 
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/0107018a7300900f-00f03678-1491-4286-9b24-c85d77649a61-00%40eu-central-1.amazonses.com.


Re: [Django] #26836: Allow applications to register links in the admin interface

2023-09-07 Thread Django
#26836: Allow applications to register links in the admin interface
-+--
 Reporter:  Mathieu Poussin  |Owner:  Shlomo
 Type:  New feature  |   Status:  closed
Component:  contrib.admin|  Version:  dev
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | 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:  assigned => closed
 * has_patch:  1 => 0
 * resolution:   => wontfix
 * stage:  Accepted => Unreviewed


Comment:

 Closing per [https://groups.google.com/g/django-developers/c/s2Sy8gXu5LM
 discussion].

-- 
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/0107018a72ebf344-420f13d7-1b6d-48aa-9efd-2558559ee900-00%40eu-central-1.amazonses.com.


Re: [Django] #33277: SimpleTestCase does not block database connections in threads

2023-09-07 Thread Django
#33277: SimpleTestCase does not block database connections in threads
-+-
 Reporter:  Daniel Hahler|Owner:  Sulabh
 |  Katila
 Type:  New feature  |   Status:  assigned
Component:  Testing framework|  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 Sulabh Katila):

 Hi David,

 I've been grappling with this issue for a while now, and I haven't made
 much progress. Given your expertise in this area, I'm reaching out for
 some much-needed guidance.

 To address this, I've been contemplating the idea of implementing a "pre-
 signal" solution. However, I must admit that I'm currently stuck, and I'm
 unsure about how to move forward.

 I had initially considered intervening at the
 BaseDataBaseWrapper.connect() level, but I haven't been able to find a
 clear and effective path for implementation.

 Since you have experience in related areas of this issue, I was hoping you
 could provide some insights. What should I be looking for, or are there
 alternative approaches that might be more suitable?

 Thank you!

 Replying to [comment:4 David Wobrock]:
 > Hey Sulabh,
 >
 > I see you assigned yourself the ticket, that's great!
 > I've started a [https://github.com/django/django/pull/17075 PR] some
 months ago, feel free to check it out if it can give you some inspiration
 :)

-- 
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/0107018a721ac3b9-7e5f425a-f64b-44b2-9994-26c10f5f41b1-00%40eu-central-1.amazonses.com.


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

2023-09-07 Thread Django
#33651: Support prefetch GenericForeignKey with custom queryset.
-+-
 Reporter:  elonzh   |Owner:  Clément
 |  Escolano
 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:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Clément Escolano):

 * needs_better_patch:  1 => 0
 * needs_tests:  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/0107018a71bff143-882f50d1-4b56-488c-868e-59c21be82a64-00%40eu-central-1.amazonses.com.


Re: [Django] #34819: GenericForeignKey.get_prefetch_queryset()

2023-09-07 Thread Django
#34819: GenericForeignKey.get_prefetch_queryset()
-+-
 Reporter:  Richard Laager   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:   |  Version:  3.2
  contrib.contenttypes   |
 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
-+-

Comment (by Natalia Bidart):

 Hello Richard, thanks for the ticket. In order for us to properly triage
 this report, would you please send a reproducer that we can use? Either a
 test case or a minimal Django project would suffice.

-- 
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/0107018a7173f508-95a1885a-428e-4e20-950f-37a1aecf3ee4-00%40eu-central-1.amazonses.com.


Re: [Django] #34818: GenericIPAddressField ValidationError incorrect message when both protocols present

2023-09-07 Thread Django
#34818: GenericIPAddressField ValidationError incorrect message when both 
protocols
present
-+-
 Reporter:  minusf   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Jay Prasad):

 Hi! This is my first open source contribution attempt! I was able to
 recreate the error and find a hacky solution to it. But it involves
 deletion of code and as a beginner, I am not too confident in that! I'd
 like to take some time and put more efforts to this issue. Any suggestions
 would be highly 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/0107018a7163ed80-bab3211b-1918-4924-a5a1-bb4d399bc868-00%40eu-central-1.amazonses.com.


Re: [Django] #34810: Calculate coverage on subprocesses such as django-admin commands

2023-09-07 Thread Django
#34810: Calculate coverage on subprocesses such as django-admin commands
-+-
 Reporter:  Jacob Walls  |Owner:  Jacob
 Type:   |  Walls
  Cleanup/optimization   |   Status:  closed
Component:  Core (Other) |  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 Natalia <124304+nessita@…>):

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


Comment:

 In [changeset:"1ab2cf7994a6f1116a96fbaedd7cadbd4b754179" 1ab2cf79]:
 {{{
 #!CommitTicketReference repository=""
 revision="1ab2cf7994a6f1116a96fbaedd7cadbd4b754179"
 Fixed #34810 -- Measured test coverage on django-admin commands.
 }}}

-- 
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/0107018a7163b018-c797b047-b524-4ec9-acdb-55bd1269cc12-00%40eu-central-1.amazonses.com.


Re: [Django] #34810: Calculate coverage on subprocesses such as django-admin commands

2023-09-07 Thread Django
#34810: Calculate coverage on subprocesses such as django-admin commands
-+-
 Reporter:  Jacob Walls  |Owner:  Jacob
 Type:   |  Walls
  Cleanup/optimization   |   Status:  assigned
Component:  Core (Other) |  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 Natalia Bidart):

 * 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/0107018a7159db82-2fb83fea-2269-4482-bdb0-08f6f48f9067-00%40eu-central-1.amazonses.com.


Re: [Django] #34819: GenericForeignKey.get_prefetch_queryset()

2023-09-07 Thread Django
#34819: GenericForeignKey.get_prefetch_queryset()
-+-
 Reporter:  Richard Laager   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:   |  Version:  3.2
  contrib.contenttypes   |
 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 Richard Laager):

 * Attachment "gfk-prefetch.patch" 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/0107018a713734c6-d86f0f6a-da48-46a1-ac80-ba0dcf630288-00%40eu-central-1.amazonses.com.


[Django] #34819: GenericForeignKey.get_prefetch_queryset()

2023-09-07 Thread Django
#34819: GenericForeignKey.get_prefetch_queryset()
+
   Reporter:  Richard Laager|  Owner:  nobody
   Type:  Bug   | Status:  new
  Component:  contrib.contenttypes  |Version:  3.2
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 `get_prefetch_queryset()` returns two functions. The caller calls them
 `rel_obj_attr` and `instance_attr`.  They return a tuple of `(pk, cls)`.
 They need to match so that objects can be pulled from the cache.  In
 `GenericForeignKey.get_prefetch_query()`, there is a bug where `gfk_key()`
 (the `rel_obj_attr`) returns a `get_prep_value()`d value but the
 `instance_attr` lambda returns `obj.pk`.

 Accordingly, for objects where the prepped value and the Python
 representation are not the same (e.g. the database uses a string and the
 Python representation is an object instance), these will not match. This
 makes things like
 `Model.objects.prefetch_related('content_object').get(id=123)` clear (set
 to `None`) the `content_object`.

 The fix is to call `get_prep_value()` in the `instance_attr` code path.

-- 
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/0107018a71370e6a-f376a90b-ca2c-485d-9a22-a15548ac9ec6-00%40eu-central-1.amazonses.com.


Re: [Django] #34808: Some aggregation functions may return None; this isn't well documented

2023-09-07 Thread Django
#34808: Some aggregation functions may return None; this isn't well documented
-+-
 Reporter:  Eric Baumgartner |Owner:  Lufafa
 Type:   |  Joshua
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  4.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
-+-
Changes (by Lufafa Joshua):

 * owner:  nobody => Lufafa Joshua
 * status:  new => assigned


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018a70bd1a8d-de3a49d6-6268-456a-a78c-9897cf5740b2-00%40eu-central-1.amazonses.com.


Re: [Django] #34817: Boolean field doesn't look good on django-admin

2023-09-07 Thread Django
#34817: Boolean field doesn't look good on django-admin
---+--
 Reporter:  Rui Oliveira   |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  contrib.admin  |  Version:  4.2
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  1
---+--
Changes (by Natalia Bidart):

 * component:  Uncategorized => contrib.admin


-- 
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/0107018a7076c71a-e7a63027-c79e-4203-ba72-3189cf017cd2-00%40eu-central-1.amazonses.com.


Re: [Django] #34816: GenericForeignKey crashes if content_type_id is changed and object_id is type incompatible with old object

2023-09-07 Thread Django
#34816: GenericForeignKey crashes if content_type_id is changed and object_id is
type incompatible with old object
-+-
 Reporter:  Richard Laager   |Owner:  Oguzhan
 |  Akan
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  4.2
  contrib.contenttypes   |
 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 Simon Charette):

 * 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/0107018a7042a58f-4030ac54-f6a0-4c81-b914-d5c1ce302e43-00%40eu-central-1.amazonses.com.


Re: [Django] #34818: GenericIPAddressField ValidationError incorrect message when both protocols present

2023-09-07 Thread Django
#34818: GenericIPAddressField ValidationError incorrect message when both 
protocols
present
-+-
 Reporter:  minusf   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

 * owner:  (none) => nobody
 * component:  Error reporting => Database layer (models, ORM)
 * stage:  Unreviewed => Accepted


Comment:

 Looks like a long-standing bug. A classic error where a class attribute is
 shared and modified by different instances. Thanks for the report.

-- 
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/0107018a7025e7c6-9d589255-4c5f-4f61-8bcb-a64b19b30b9d-00%40eu-central-1.amazonses.com.


Re: [Django] #34818: GenericIPAddressField ValidationError incorrect message when both protocols present

2023-09-07 Thread Django
#34818: GenericIPAddressField ValidationError incorrect message when both 
protocols
present
-+--
 Reporter:  minusf   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Error reporting  |  Version:  4.2
 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
-+--
Description changed by minusf:

Old description:

> It seems that the `invalid` code for `GenericIPAddressField` models gets
> clobbered when both protocols are present in a model:
>
> {{{
> class Site(models.Model):
> ipv6 = models.GenericIPAddressField(protocol="IPv6")
> ipv4 = models.GenericIPAddressField(protocol="IPv4")
> }}}
>
> {{{
> >>> site = Site(ipv6="6", ipv4="4")
> >>> site.full_clean()
> raceback (most recent call last):
>   File "", line 1, in 
>   File "/src/tmp/ip_bug/venv/lib/python3.10/site-
> packages/django/db/models/base.py", line 1502, in full_clean
> raise ValidationError(errors)
> django.core.exceptions.ValidationError: {'ipv6': ['Enter a valid IPv4
> address.'], 'ipv4': ['Enter a valid IPv4 address.']}
> }}}
> sometimes the other message wins:
> {{{
> ValidationError: {'ipv6': ['Enter a valid IPv6 address.'], 'ipv4':
> ['Enter a valid IPv6 address.']}
> }}}
>
> p.s. not sure about the component, perhaps could be "Database Layer:
> Models" or "Error reporting"?

New description:

 It seems that the `invalid` code for `GenericIPAddressField` models gets
 clobbered when both protocols are present in a model:

 {{{
 class Site(models.Model):
 ipv6 = models.GenericIPAddressField(protocol="IPv6")
 ipv4 = models.GenericIPAddressField(protocol="IPv4")
 }}}

 {{{
 >>> site = Site(ipv6="6", ipv4="4")
 >>> site.full_clean()
 Traceback (most recent call last):
   File "", line 1, in 
   File "/src/tmp/ip_bug/venv/lib/python3.10/site-
 packages/django/db/models/base.py", line 1502, in full_clean
 raise ValidationError(errors)
 django.core.exceptions.ValidationError: {'ipv6': ['Enter a valid IPv4
 address.'], 'ipv4': ['Enter a valid IPv4 address.']}
 }}}
 sometimes the other message wins:
 {{{
 ValidationError: {'ipv6': ['Enter a valid IPv6 address.'], 'ipv4': ['Enter
 a valid IPv6 address.']}
 }}}

 p.s. not sure about the component, perhaps could be "Database Layer:
 Models" or "Error reporting"?

--

-- 
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/0107018a6ff56751-a7379b02-eeae-45d2-90c1-1d4826750fb8-00%40eu-central-1.amazonses.com.


[Django] #34818: GenericIPAddressField ValidationError incorrect message when both protocols present

2023-09-07 Thread Django
#34818: GenericIPAddressField ValidationError incorrect message when both 
protocols
present
---+
   Reporter:  minusf   |  Owner:  (none)
   Type:  Bug  | Status:  new
  Component:  Error reporting  |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|
---+
 It seems that the `invalid` code for `GenericIPAddressField` models gets
 clobbered when both protocols are present in a model:

 {{{
 class Site(models.Model):
 ipv6 = models.GenericIPAddressField(protocol="IPv6")
 ipv4 = models.GenericIPAddressField(protocol="IPv4")
 }}}

 {{{
 >>> site = Site(ipv6="6", ipv4="4")
 >>> site.full_clean()
 raceback (most recent call last):
   File "", line 1, in 
   File "/src/tmp/ip_bug/venv/lib/python3.10/site-
 packages/django/db/models/base.py", line 1502, in full_clean
 raise ValidationError(errors)
 django.core.exceptions.ValidationError: {'ipv6': ['Enter a valid IPv4
 address.'], 'ipv4': ['Enter a valid IPv4 address.']}
 }}}
 sometimes the other message wins:
 {{{
 ValidationError: {'ipv6': ['Enter a valid IPv6 address.'], 'ipv4': ['Enter
 a valid IPv6 address.']}
 }}}

 p.s. not sure about the component, perhaps could be "Database Layer:
 Models" or "Error reporting"?

-- 
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/0107018a6ff49aa6-7e153824-780a-4c97-a6ca-ccbbdc5bbdf7-00%40eu-central-1.amazonses.com.


Re: [Django] #34817: Boolean field doesn't look good on django-admin

2023-09-07 Thread Django
#34817: Boolean field doesn't look good on django-admin
---+--
 Reporter:  Rui Oliveira   |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Uncategorized  |  Version:  4.2
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  1
---+--
Changes (by Natalia Bidart):

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


Comment:

 Hello, thank you for your ticket.

 There hasn't been changes regarding how boolean fields are displayed. If
 you have concerns from the usability point of view, please start a new
 post in the [https://forum.djangoproject.com/c/internals/5 Django Forum],
 where you'll reach a wider audience and likely get richer feedback.

-- 
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/0107018a6fef43bb-621ee723-48b5-445a-98fe-9df0baf7e12c-00%40eu-central-1.amazonses.com.


[Django] #34817: Boolean field doesn't look good on django-admin

2023-09-07 Thread Django
#34817: Boolean field doesn't look good on django-admin
-+
   Reporter:  ruilvo |  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:  1  |
-+
 I have a model with a boolean field. After registering the model on
 django-admin, it looks like this:

 [[Image(https://i.gyazo.com/10e567c2353104e76c9fa1d157fa82a4.png)]]

 I'd expect the label to be aligned at the left with all the others, and
 the checkbox to be aligned at the right with all the other ones as well.

 This is on latest Django as of 2023/09/07.

-- 
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/0107018a6f9f4784-6348b4a3-0484-46e6-8f55-34ae018994ef-00%40eu-central-1.amazonses.com.


Re: [Django] #34791: Prefetch's queryset attribute is ignored when the same nested relation is used multiple times.

2023-09-07 Thread Django
#34791: Prefetch's queryset attribute is ignored when the same nested relation 
is
used multiple times.
-+-
 Reporter:  Maxime Toussaint |Owner:  Maxime
 |  Toussaint
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  prefetch,| Triage Stage:  Ready for
  prefetch_related   |  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:"254df3a3bbc2f4df51f9e2070ab2e214553f67d0" 254df3a]:
 {{{
 #!CommitTicketReference repository=""
 revision="254df3a3bbc2f4df51f9e2070ab2e214553f67d0"
 Fixed #34791 -- Fixed incorrect Prefetch()'s cache for singly related
 objects.

 Changed the cache name used for singly related objects to be the
 to_attr parameter passed to a Prefetch object. This fixes issues with
 checking if values have already been fetched in cases where the Field
 already has some prefetched value, but not for the same model attr.
 }}}

-- 
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/0107018a6f8310de-d827fbde-e69e-44b7-a86b-1108593d5291-00%40eu-central-1.amazonses.com.


Re: [Django] #34791: Prefetch's queryset attribute is ignored when the same nested relation is used multiple times.

2023-09-07 Thread Django
#34791: Prefetch's queryset attribute is ignored when the same nested relation 
is
used multiple times.
-+-
 Reporter:  Maxime Toussaint |Owner:  Maxime
 |  Toussaint
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  4.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  prefetch,| Triage Stage:  Ready for
  prefetch_related   |  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/0107018a6f5886b6-ff709903-7af5-43b0-8af5-01fce816121d-00%40eu-central-1.amazonses.com.


Re: [Django] #34816: GenericForeignKey crashes if content_type_id is changed and object_id is type incompatible with old object

2023-09-07 Thread Django
#34816: GenericForeignKey crashes if content_type_id is changed and object_id is
type incompatible with old object
-+-
 Reporter:  Richard Laager   |Owner:  Oguzhan
 |  Akan
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  4.2
  contrib.contenttypes   |
 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 Oguzhan Akan):

 * owner:  nobody => Oguzhan Akan
 * status:  new => assigned


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018a6f367ebc-a6763d79-5074-40c0-952a-8fe567574e74-00%40eu-central-1.amazonses.com.


Re: [Django] #31300: Add function-based virtual fields.

2023-09-07 Thread Django
#31300: Add function-based virtual fields.
-+-
 Reporter:  Dulmandakh   |Owner:  Jeremy
 |  Nauta
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  field, database, | Triage Stage:  Ready for
  generated  |  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:"f333e3513e8bdf5ffeb6eeb63021c230082e6f95" f333e35]:
 {{{
 #!CommitTicketReference repository=""
 revision="f333e3513e8bdf5ffeb6eeb63021c230082e6f95"
 Fixed #31300 -- Added GeneratedField model field.

 Thanks Adam Johnson and Paolo Melchiorre for reviews.

 Co-Authored-By: Lily Foote 
 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/0107018a6eae882e-5eedce06-cab0-4530-8146-e3b2a6756ce7-00%40eu-central-1.amazonses.com.


Re: [Django] #34816: GenericForeignKey crashes if content_type_id is changed and object_id is type incompatible with old object

2023-09-07 Thread Django
#34816: GenericForeignKey crashes if content_type_id is changed and object_id is
type incompatible with old object
--+
 Reporter:  Richard Laager|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  contrib.contenttypes  |  Version:  4.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
--+
Changes (by Mariusz Felisiak):

 * type:  Uncategorized => Bug
 * stage:  Unreviewed => Accepted


Comment:

 I was able to reproduce the issue with the following test:
 {{{#!diff
 diff --git a/tests/generic_relations_regress/tests.py
 b/tests/generic_relations_regress/tests.py
 index b7ecb499eb..7b7883ee88 100644
 --- a/tests/generic_relations_regress/tests.py
 +++ b/tests/generic_relations_regress/tests.py
 @@ -314,6 +314,18 @@ class GenericRelationTests(TestCase):
  result = Link.objects.filter(places=place)
  self.assertCountEqual(result, [link])

 +def test_1(self):
 +from django.contrib.contenttypes.models import ContentType
 +
 +board = Board.objects.create(name="some test")
 +oddrel = OddRelation1.objects.create(name="clink")
 +charlink = CharLink.objects.create(content_object=oddrel)
 +charlink = CharLink.objects.get(pk=charlink.pk)
 +charlink.content_object
 +charlink.object_id = board.pk
 +charlink.content_type_id =
 ContentType.objects.get_for_model(Board).id
 +charlink.content_object
 +
  def test_generic_reverse_relation_with_abc(self):
  """
  The reverse generic relation accessor (targets) is created if the

 }}}

-- 
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/0107018a6eaa5b4d-3e1fc4e8-8636-4005-803b-9bc7370176b4-00%40eu-central-1.amazonses.com.