Re: [Django] #29139: Aggregate functions failing when using Postgres JSON field KeyTransform

2019-04-17 Thread Django
#29139: Aggregate functions failing when using Postgres JSON field KeyTransform
-+-
 Reporter:  trik |Owner:  ddio
 Type:  Bug  |   Status:  closed
Component:  contrib.postgres |  Version:  2.2
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  json keytransform| Triage Stage:  Accepted
  unhashable |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"e85317d73113382c96e87f36f0d732e3084df145" e85317d7]:
 {{{
 #!CommitTicketReference repository=""
 revision="e85317d73113382c96e87f36f0d732e3084df145"
 [2.2.x] Fixed #30335, #29139 -- Fixed crash when ordering or aggregating
 over a nested JSONField key transform.

 Backport of d87bd29c4f8dfcdf3f4a4eb8340e6770a2416fe3 from master.
 }}}

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.e32e6eeb39b1bf8669482edceb6bc69e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30335: TypeError: unhashable type: 'list' when paginating queryset with KeyTransform annotation

2019-04-17 Thread Django
#30335: TypeError: unhashable type: 'list' when paginating queryset with
KeyTransform annotation
-+-
 Reporter:  Jaap Roes|Owner:  Can
 |  Sarıgöl
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  postgresql jsonb | Triage Stage:  Ready for
  keytransform annotation|  checkin
  pagination |
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:"e85317d73113382c96e87f36f0d732e3084df145" e85317d7]:
 {{{
 #!CommitTicketReference repository=""
 revision="e85317d73113382c96e87f36f0d732e3084df145"
 [2.2.x] Fixed #30335, #29139 -- Fixed crash when ordering or aggregating
 over a nested JSONField key transform.

 Backport of d87bd29c4f8dfcdf3f4a4eb8340e6770a2416fe3 from master.
 }}}

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.49134131906c0be161e23da9bcaccc29%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29139: Aggregate functions failing when using Postgres JSON field KeyTransform

2019-04-17 Thread Django
#29139: Aggregate functions failing when using Postgres JSON field KeyTransform
-+-
 Reporter:  trik |Owner:  ddio
 Type:  Bug  |   Status:  closed
Component:  contrib.postgres |  Version:  2.2
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  json keytransform| Triage Stage:  Accepted
  unhashable |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * version:  2.0 => 2.2


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.6ae408bd28194088c93662ad106d9a09%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30335: TypeError: unhashable type: 'list' when paginating queryset with KeyTransform annotation

2019-04-17 Thread Django
#30335: TypeError: unhashable type: 'list' when paginating queryset with
KeyTransform annotation
-+-
 Reporter:  Jaap Roes|Owner:  Can
 |  Sarıgöl
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:  postgresql jsonb | Triage Stage:  Ready for
  keytransform annotation|  checkin
  pagination |
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:"d87bd29c4f8dfcdf3f4a4eb8340e6770a2416fe3" d87bd29]:
 {{{
 #!CommitTicketReference repository=""
 revision="d87bd29c4f8dfcdf3f4a4eb8340e6770a2416fe3"
 Fixed #30335, #29139 -- Fixed crash when ordering or aggregating over a
 nested JSONField key transform.
 }}}

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.d35d75122a4133507df5a7e7761bf2dd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29139: Aggregate functions failing when using Postgres JSON field KeyTransform

2019-04-17 Thread Django
#29139: Aggregate functions failing when using Postgres JSON field KeyTransform
-+-
 Reporter:  trik |Owner:  ddio
 Type:  Bug  |   Status:  closed
Component:  contrib.postgres |  Version:  2.0
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  json keytransform| Triage Stage:  Accepted
  unhashable |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

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


Comment:

 In [changeset:"d87bd29c4f8dfcdf3f4a4eb8340e6770a2416fe3" d87bd29]:
 {{{
 #!CommitTicketReference repository=""
 revision="d87bd29c4f8dfcdf3f4a4eb8340e6770a2416fe3"
 Fixed #30335, #29139 -- Fixed crash when ordering or aggregating over a
 nested JSONField key transform.
 }}}

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.73bad10cfcbed0cbe752a0ce8fbd956c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30381: django/contrib/auth/migrations/0011_update_proxy_permissions.py can cause a unique constraint violation

2019-04-17 Thread Django
#30381: django/contrib/auth/migrations/0011_update_proxy_permissions.py can 
cause a
unique constraint violation
--+--
 Reporter:  Jon Dufresne  |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  contrib.auth  |  Version:  2.2
 Severity:  Normal|   Resolution:  duplicate
 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 Simon Charette):

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


Comment:

 Duplicate of #30351.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.90d5ecd2c879ac7e5ec0f6dd938f9604%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30381: django/contrib/auth/migrations/0011_update_proxy_permissions.py can cause a unique constraint violation

2019-04-17 Thread Django
#30381: django/contrib/auth/migrations/0011_update_proxy_permissions.py can 
cause a
unique constraint violation
+
   Reporter:  Jon Dufresne  |  Owner:  nobody
   Type:  Bug   | Status:  new
  Component:  contrib.auth  |Version:  2.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 |
+
 Use an existing database that was migrated using Django 2.1. This must
 contain auth permissions for proxy models. Per Django 2.1,
 `Permission.content_type` points to the concrete model's content type, not
 the proxy's.

 Once this database exists, steps to reproduce:

 1. Run a subset of migrations that includes the proxy model's app but does
 not include `0011_update_proxy_permissions`.
 2. This triggers the auth `create_permissions()` post migrate handler.
 3. `create_permissions()` generates new permissions for the proxy models
 that point to the proxy content type. The old ones that point to the
 concrete model still exist.
 4. Now run all migrations.
 5. `auth.0011_update_proxy_permissions` runs and tries to update the pre-
 existing proxy models. But as the auth permissions were already created
 during the previous migration run, this crashes with a unique constraint
 violation.

 Traceback (PostgreSQL backend):

 {{{
 Traceback (most recent call last):
   ...
   File ".../venv/lib64/python3.7/site-
 packages/django/core/management/commands/migrate.py", line 234, in handle
 fake_initial=fake_initial,
   File ".../venv/lib64/python3.7/site-
 packages/django/db/migrations/executor.py", line 117, in migrate
 state = self._migrate_all_forwards(state, plan, full_plan, fake=fake,
 fake_initial=fake_initial)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/migrations/executor.py", line 147, in
 _migrate_all_forwards
 state = self.apply_migration(state, migration, fake=fake,
 fake_initial=fake_initial)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/migrations/executor.py", line 245, in apply_migration
 state = migration.apply(state, schema_editor)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/migrations/migration.py", line 124, in apply
 operation.database_forwards(self.app_label, schema_editor, old_state,
 project_state)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/migrations/operations/special.py", line 190, in
 database_forwards
 self.code(from_state.apps, schema_editor)
   File ".../venv/lib64/python3.7/site-
 packages/django/contrib/auth/migrations/0011_update_proxy_permissions.py",
 line 30, in update_proxy_model_permissions
 ).update(content_type=new_content_type)
   File ".../venv/lib64/python3.7/site-packages/django/db/models/query.py",
 line 741, in update
 rows = query.get_compiler(self.db).execute_sql(CURSOR)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/models/sql/compiler.py", line 1426, in execute_sql
 cursor = super().execute_sql(result_type)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/models/sql/compiler.py", line 1097, in execute_sql
 cursor.execute(sql, params)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/backends/utils.py", line 99, in execute
 return super().execute(sql, params)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/backends/utils.py", line 67, in execute
 return self._execute_with_wrappers(sql, params, many=False,
 executor=self._execute)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
 return executor(sql, params, many, context)
   File ".../venv/lib64/python3.7/site-
 packages/django/db/backends/utils.py", line 84, in _execute
 return self.cursor.execute(sql, params)
   File ".../venv/lib64/python3.7/site-packages/django/db/utils.py", line
 89, in __exit__
 raise dj_exc_value.with_traceback(traceback) from exc_value
   File ".../venv/lib64/python3.7/site-
 packages/django/db/backends/utils.py", line 84, in _execute
 return self.cursor.execute(sql, params)
 django.db.utils.IntegrityError: duplicate key value violates unique
 constraint "auth_permission_content_type_id_01ab375a_uniq"
 DETAIL:  Key (content_type_id, codename)=(168, add_myproxymodel) already
 exists.
 }}}

-- 
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 

Re: [Django] #29352: Allow specifying a Feed language different from settings.LANGUAGE_CODE

2019-04-17 Thread Django
#29352: Allow specifying a Feed language different from settings.LANGUAGE_CODE
--+
 Reporter:  phenelleevolio|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.syndication   |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:  rss   | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tobias Kunze):

 * needs_docs:  1 => 0
 * needs_tests:  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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.0981934eef494248765a86a83682a7fb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29352: Allow specifying a Feed language different from settings.LANGUAGE_CODE

2019-04-17 Thread Django
#29352: Allow specifying a Feed language different from settings.LANGUAGE_CODE
--+
 Reporter:  phenelleevolio|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.syndication   |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  rss   | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tobias Kunze):

 * version:  1.11 => master


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.6db0c56d8404f49f29a499bb00b8db68%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30380: Support mysql query objects as strings in addition to bytes, for PyMySQL support

2019-04-17 Thread Django
#30380: Support mysql query objects as strings in addition to bytes, for PyMySQL
support
-+
   Reporter:  Nathan Klug|  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Uncategorized  |Version:  2.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  |
-+
 Per https://github.com/PyMySQL/PyMySQL/issues/790, Django 2.2 changed the
 expected type of mysql queries; it's be great if we could support both
 mysqlclient and PyMySQL here. More details from that issue:

 Django 2.1.x used to cast every query into "str" like below
 
https://github.com/django/django/blob/stable/2.1.x/django/db/backends/mysql/operations.py#L134

 Django 2.2.x they changed the code by using query.decode instead of
 force_text method.
 
https://github.com/django/django/blob/stable/2.2.x/django/db/backends/mysql/operations.py#L140

 Could you also help open a ticket on Django's issue tracking system ?
 It's relatively easy to fix from Django side.

 e.g.
 {{{
 from django.utils.encoding import force_text

 def last_executed_query(self, cursor, sql, params):
 # With MySQLdb, cursor objects have an (undocumented) "_executed"
 # attribute where the exact query sent to the database is saved.
 # See MySQLdb/cursors.py in the source distribution.
 query = getattr(cursor, '_executed', None)
 if query is not None:
 if type(query) == bytes:
 query = query.decode(errors='replace')  # mysqlclient
 elif type(query) == str:
 query = query.encode(errors='replace')   # PyMySQL
 else:
 query = force_text(query, errors='replace')  # fallback
 compatibility ?
 return query
 }}}

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.7877a625500e710415da95261d36b211%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30371: sqlmigrate fails with string defaults on mysql

2019-04-17 Thread Django
#30371: sqlmigrate fails with string defaults on mysql
-+-
 Reporter:  Melvyn Sopacua   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  needsinfo
 Keywords:  regression   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Claude Paroz):

 The code counts on the fact that `connection.escape()` will return a
 bytestring for a `str` value. Note the `isinstance` test is done on
 `value` but the `decode()` is called on `quoted`.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.e957ef846cca56815897bebe2556587f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30379: ProgrammingError from exclude using models.F with long relation

2019-04-17 Thread Django
#30379: ProgrammingError from exclude using models.F with long relation
-+-
 Reporter:  PeterJCLaw   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 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 PeterJCLaw):

 Interestingly, attempting to cut this down further results in both the
 relative and specific spellings of the query emitting similar errors.
 Given:
 {{{#!python
 class Item(models.Model):
 name = models.TextField()

 class UserItem(models.Model):
 user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
 item = models.ForeignKey(Item, on_delete=models.CASCADE,
 related_name='user_items')

 class Alert(models.Model):
 user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
 item = models.ForeignKey(Item, on_delete=models.CASCADE,
 related_name='alerts')
 }}}

 then both
 {{{#!python
 Alert.objects.exclude(item__order_items__user=models.F('user'))
 }}}
 and
 {{{#!python
 Alert.objects.exclude(item__order_items__user=the_user)
 }}}
 both emit `ProgrammingError`s.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.15a2d568e20fda6c34d10f88e453ab5a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30379: ProgrammingError from exclude using models.F with long relation

2019-04-17 Thread Django
#30379: ProgrammingError from exclude using models.F with long relation
-+-
 Reporter:  PeterJCLaw   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 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 felixxm):

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


Comment:

 Duplicate of #21703.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.39e867a9925785d6ba1c1bdba67a2852%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30379: ProgrammingError from exclude using models.F with long relation

2019-04-17 Thread Django
#30379: ProgrammingError from exclude using models.F with long relation
-+-
 Reporter:  PeterJCLaw   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 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 PeterJCLaw:

Old description:

> The following query emits a `ProgrammingError` due to the query omitting
> the definitions of a number of references it uses:
> {{{#!python
> Alert.objects.exclude(
> item__order_items__order__user=models.F('user'),
> )
> }}}
>
> {{{
> django.db.utils.ProgrammingError: missing FROM-clause entry for table
> "u2"
> }}}
>
> The spelling using a specific user does seem to work correctly, hinting
> that the issue is somehow related to the handling of the `models.F`
> component.
>
> {{{#!python
> Alert.objects.exclude(
> item__order_items__order__user=the_user,
> )
> }}}
>
> Models:
> {{{#!python
> from django.db import models
>
> class Item(models.Model):
> name = models.TextField()
>
> class Order(models.Model):
> user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
>
> class UnsizedOrderItem(models.Model):
> order = models.ForeignKey(Order, on_delete=models.CASCADE,
> related_name='items')
> item = models.ForeignKey(Item, on_delete=models.CASCADE,
> related_name='order_items')
>
> class Alert(models.Model):
> user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
> item = models.ForeignKey(Item, on_delete=models.CASCADE,
> related_name='alerts')
> }}}
>
> I originally saw this with another layer of many-to-many between the item
> and the order, but that turned out not to be necessary to reproduce the
> issue:
> {{{#!python
> class SizedItem(models.Model):
> item = models.ForeignKey(Item, on_delete=models.CASCADE,
> related_name='sizes')
> size = models.TextField()
>
> class SizedOrderItem(models.Model):
> order = models.ForeignKey(Order, on_delete=models.CASCADE,
> related_name='sized_items')
> sized_item = models.ForeignKey(SizedItem, on_delete=models.CASCADE,
> related_name='sized_order_items')
>
> Alert.objects.exclude(
> item__sizes__sized_order_items__order__user=models.F('user'),
> )
> }}}
>
> Traceback:
> {{{
>   File ".../lib/python3.5/site-packages/django/db/models/query.py", line
> 55, in __iter__
> results = compiler.execute_sql(chunked_fetch=self.chunked_fetch,
> chunk_size=self.chunk_size)
>   File ".../lib/python3.5/site-
> packages/django/db/models/sql/compiler.py", line 1097, in execute_sql
> cursor.execute(sql, params)
>   File ".../lib/python3.5/site-
> packages/sentry_sdk/integrations/django/__init__.py", line 298, in
> execute
> return real_execute(self, sql, params)
>   File "/home/peter-thread/thread/styleme/styleme/graphql/metrics.py",
> line 112, in wrapper
> return fn(wrapped_self, *args, **kwargs)
>   File ".../lib/python3.5/site-packages/django/db/backends/utils.py",
> line 67, in execute
> return self._execute_with_wrappers(sql, params, many=False,
> executor=self._execute)
>   File ".../lib/python3.5/site-packages/django/db/backends/utils.py",
> line 76, in _execute_with_wrappers
> return executor(sql, params, many, context)
>   File ".../lib/python3.5/site-packages/django/db/backends/utils.py",
> line 84, in _execute
> return self.cursor.execute(sql, params)
>   File ".../lib/python3.5/site-packages/django/db/utils.py", line 89, in
> __exit__
> raise dj_exc_value.with_traceback(traceback) from exc_value
>   File ".../lib/python3.5/site-packages/django/db/backends/utils.py",
> line 84, in _execute
> return self.cursor.execute(sql, params)
> django.db.utils.ProgrammingError: missing FROM-clause entry for table
> "u2"
> LINE 1: ...JOIN "liked_email_alerts_unsizedorderitem" U3 ON (U2."id" =
> ...
>  ^
> }}}
>
> Versions:
>  * I've seen this under both 2.1.7 and 2.2
>  * I'm using Python 3.5.2
>  * I'm using Postgres 9.6 (psycopg2-binary==2.7.7)
>
> For reference here's the SQL generated by printing the `.query` on the
> querysets:
> {{{#!sql
> -- relative
>
> SELECT
> "liked_email_alerts_alert"."id",
> "liked_email_alerts_alert"."user_id",
> "liked_email_alerts_alert"."item_id"
> FROM
> "liked_email_alerts_alert"
> WHERE
> NOT ("liked_email_alerts_alert"."item_id" IN (
> SELECT
> 

[Django] #30379: ProgrammingError from exclude using models.F with long relation

2019-04-17 Thread Django
#30379: ProgrammingError from exclude using models.F with long relation
-+-
   Reporter: |  Owner:  nobody
  PeterJCLaw |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  2.2
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 The following query emits a `ProgrammingError` due to the query omitting
 the definitions of a number of references it uses:
 {{{#!python
 Alert.objects.exclude(
 item__order_items__order__user=models.F('user'),
 )
 }}}

 {{{
 django.db.utils.ProgrammingError: missing FROM-clause entry for table "u2"
 }}}

 The spelling using a specific user does seem to work correctly, hinting
 that the issue is somehow related to the handling of the `models.F`
 component.

 {{{#!python
 Alert.objects.exclude(
 item__order_items__order__user=the_user,
 )
 }}}

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

 class Item(models.Model):
 name = models.TextField()

 class Order(models.Model):
 user = models.ForeignKey('auth.User', on_delete=models.CASCADE)

 class UnsizedOrderItem(models.Model):
 order = models.ForeignKey(Order, on_delete=models.CASCADE,
 related_name='items')
 item = models.ForeignKey(Item, on_delete=models.CASCADE,
 related_name='order_items')

 class Alert(models.Model):
 user = models.ForeignKey('auth.User', on_delete=models.CASCADE)
 item = models.ForeignKey(Item, on_delete=models.CASCADE,
 related_name='alerts')
 }}}

 I originally saw this with another layer of many-to-many between the item
 and the order, but that turned out not to be necessary to reproduce the
 issue:
 {{{#!python
 class SizedItem(models.Model):
 item = models.ForeignKey(Item, on_delete=models.CASCADE,
 related_name='sizes')
 size = models.TextField()

 class SizedOrderItem(models.Model):
 order = models.ForeignKey(Order, on_delete=models.CASCADE,
 related_name='sized_items')
 sized_item = models.ForeignKey(SizedItem, on_delete=models.CASCADE,
 related_name='sized_order_items')

 Alert.objects.exclude(
 item__sizes__sized_order_items__order__user=models.F('user'),
 )
 }}}

 Traceback:
 {{{
   File ".../lib/python3.5/site-packages/django/db/models/query.py", line
 55, in __iter__
 results = compiler.execute_sql(chunked_fetch=self.chunked_fetch,
 chunk_size=self.chunk_size)
   File ".../lib/python3.5/site-packages/django/db/models/sql/compiler.py",
 line 1097, in execute_sql
 cursor.execute(sql, params)
   File ".../lib/python3.5/site-
 packages/sentry_sdk/integrations/django/__init__.py", line 298, in execute
 return real_execute(self, sql, params)
   File "/home/peter-thread/thread/styleme/styleme/graphql/metrics.py",
 line 112, in wrapper
 return fn(wrapped_self, *args, **kwargs)
   File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line
 67, in execute
 return self._execute_with_wrappers(sql, params, many=False,
 executor=self._execute)
   File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line
 76, in _execute_with_wrappers
 return executor(sql, params, many, context)
   File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line
 84, in _execute
 return self.cursor.execute(sql, params)
   File ".../lib/python3.5/site-packages/django/db/utils.py", line 89, in
 __exit__
 raise dj_exc_value.with_traceback(traceback) from exc_value
   File ".../lib/python3.5/site-packages/django/db/backends/utils.py", line
 84, in _execute
 return self.cursor.execute(sql, params)
 django.db.utils.ProgrammingError: missing FROM-clause entry for table "u2"
 LINE 1: ...JOIN "liked_email_alerts_unsizedorderitem" U3 ON (U2."id" = ...
  ^
 }}}

 Versions:
  * I've seen this under both 2.1.7 and 2.2
  * I'm using Python 3.5.2
  * I'm using Postgres 9.6 (psycopg2-binary==2.7.7)

 For reference here's the SQL generated by printing the `.query` on the
 querysets:
 {{{#!sql
 -- relative

 SELECT
 "liked_email_alerts_alert"."id",
 "liked_email_alerts_alert"."user_id",
 "liked_email_alerts_alert"."item_id"
 FROM
 "liked_email_alerts_alert"
 WHERE
 NOT ("liked_email_alerts_alert"."item_id" IN (
 SELECT
 U3. "item_id"
 FROM
 "liked_email_alerts_alert" U0
 INNER JOIN "liked_email_alerts_unsizedorderitem" U3 ON
 (U2. "id" = U3. "item_id")
 INNER JOIN "liked_email_alerts_order" U4 ON 

Re: [Django] #30374: Paginator UnorderedObjectListWarning on union(all=True) of two sorted queries

2019-04-17 Thread Django
#30374: Paginator UnorderedObjectListWarning on union(all=True) of two sorted
queries
-+-
 Reporter:  Rich Rauenzahn   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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:  0
-+-

Comment (by Rich Rauenzahn):

 ...Actually.  I could have sworn I read somewhere that union(all=True)
 preserves order because it doesn't remove duplicates, but I can't find it
 again.

 Postgres says:

 > UNION effectively appends the result of query2 to the result of query1
 (although there is no guarantee that this is the order in which the rows
 are actually returned).
 > Furthermore, it eliminates duplicate rows from its result, in the same
 way as DISTINCT, unless UNION ALL is used.

 In practice it appears to be true, but I don't think it's strictly defined
 in the spec.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.302aefa87e4bf23a012c0bca38f8d726%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30374: Paginator UnorderedObjectListWarning on union(all=True) of two sorted queries

2019-04-17 Thread Django
#30374: Paginator UnorderedObjectListWarning on union(all=True) of two sorted
queries
-+-
 Reporter:  Rich Rauenzahn   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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:  0
-+-

Comment (by Rich Rauenzahn):

 I *can't* add an `order_by()` because the key I need to sort by isn't in
 columns union'ed -- and sorting the union by `common_key` would *unorder*
 the sort by `foreign_relationship__value`

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.8476d857b9cdd0c7f58c6a5fdfdc9c5a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #20581: Support DEFERRABLE INITIALLY DEFERRED for UNIQUE constraints

2019-04-17 Thread Django
#20581: Support DEFERRABLE INITIALLY DEFERRED for UNIQUE constraints
-+-
 Reporter:  dmadeley@…   |Owner:  Ian Foote
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  db-indexes   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by felixxm):

 [https://github.com/django/django/pull/10338 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/085.dd2e122bc7298d822e9498c5cd3ce3ba%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #18676: Django should do m2m deletes in a single query when possible

2019-04-17 Thread Django
#18676: Django should do m2m deletes in a single query when possible
-+-
 Reporter:  Jeremy Dunck |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Mariusz Felisiak ):

 In [changeset:"26c4be2ebe918601c0a13d4abb3f3cab49107c73" 26c4be2e]:
 {{{
 #!CommitTicketReference repository=""
 revision="26c4be2ebe918601c0a13d4abb3f3cab49107c73"
 Refs #18676 -- Enabled fast-delete for m2m_changed senders.

 There's no reason to disable fast-delete when an intermediary
 many-to-many model has connected m2m_changed receivers because the
 signal is only sent when related manager's clear() and remove() methods
 are directly called.

 This must have been overlooked in 1cd6e04cd4f768bcd4385b75de433d497d938f82
 given no regression tests fail when m2m_changed is not taken into
 consideration to determine if fast-delete can be enabled.
 }}}

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.5a08fafecfae824487a6365c0a930194%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30191: Optimize .delete() to use only required fields.

2019-04-17 Thread Django
#30191: Optimize .delete() to use only required fields.
-+-
 Reporter:  Ed Morley|Owner:  Simon
 Type:   |  Charette
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 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 ):

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


Comment:

 In [changeset:"f110de5c04818b8f915dcf65da37a50c1424c6e6" f110de5c]:
 {{{
 #!CommitTicketReference repository=""
 revision="f110de5c04818b8f915dcf65da37a50c1424c6e6"
 Fixed #30191 -- Selected only referenced fields during cascade deletion.

 The non-referenced fields can only be deferred if no deletion signals
 receivers are connected for their respective model as connected as these
 receivers might expect all fields of the deleted model to be present.

 Thanks Ed Morley 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.18285d7b5297b70773725938686ac6f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26678: Document that ManyRelatedManager.add()/remove() can take primary keys

2019-04-17 Thread Django
#26678: Document that ManyRelatedManager.add()/remove() can take primary keys
-+-
 Reporter:  Antonin  |Owner:  Tobias
 Type:   |  Kunze
  Cleanup/optimization   |   Status:  assigned
Component:  Documentation|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  add ManyToMany   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tobias Kunze):

 * owner:  nobody => Tobias Kunze
 * needs_better_patch:  1 => 0
 * 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.0c2e28fad36fae612914b6a4ae36a091%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30352: Error al ejecutar python manage.py sin sealizar cambios

2019-04-17 Thread Django
#30352: Error al ejecutar python manage.py sin sealizar cambios
-+-
 Reporter:  irv-ro-j |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (System |  Version:  2.2
  checks)|
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  Reload Django| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * status:  new => closed
 * 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.745527dba451fc2ac41411cdaeaa5df5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30377: Exceptions when viewing project on local machine

2019-04-17 Thread Django
#30377: Exceptions when viewing project on local machine
---+--
 Reporter:  Chaos  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  HTTP handling  |  Version:  2.2
 Severity:  Normal |   Resolution:  worksforme
 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 felixxm):

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


Comment:

 I was not able to reproduce this issue. IMO it is some Windows issue
 related with sockets. I wouldn't blame Django, see
 {{{
 ConnectionAbortedError: [WinError 10053] An established connection was
 aborted by the software in your host machine
 }}}
 maybe antivirus or firewall blocks connections, it is hard to tell.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.89d003d7410646f81a17eff89974d1e2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30335: TypeError: unhashable type: 'list' when paginating queryset with KeyTransform annotation

2019-04-17 Thread Django
#30335: TypeError: unhashable type: 'list' when paginating queryset with
KeyTransform annotation
-+-
 Reporter:  Jaap Roes|Owner:  Can
 |  Sarıgöl
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:
 Keywords:  postgresql jsonb | Triage Stage:  Ready for
  keytransform annotation|  checkin
  pagination |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.25566db491212a1ad5a120bfedb74be1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28919: Add support for Common Table Expression (CTE) queries

2019-04-17 Thread Django
#28919: Add support for Common Table Expression (CTE) queries
-+-
 Reporter:  Daniel Miller|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  QuerySet.extra   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by TZanke):

 * cc: TZanke (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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6ecdace98078f3c4a9b1d030f19dab5c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30371: sqlmigrate fails with string defaults on mysql

2019-04-17 Thread Django
#30371: sqlmigrate fails with string defaults on mysql
-+-
 Reporter:  Melvyn Sopacua   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  needsinfo
 Keywords:  regression   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Melvyn Sopacua):

 If you can't reproduce it, you have dead code, cause str.decode() simply
 isn't a thing.

 However, it may be caused by an extension. I will have time on Friday to
 investigate.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.3e0d8f679ebe328e6c84cac7ce7f0ab6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30378: AttributeError: 'NoneType' object has no attribute 'split'

2019-04-17 Thread Django
#30378: AttributeError: 'NoneType' object has no attribute 'split'
--+--
 Reporter:  PM|Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Core (Other)  |  Version:  master
 Severity:  Normal|   Resolution:  duplicate
 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 felixxm):

 * status:  new => closed
 * type:  Uncategorized => Bug
 * version:  2.1 => master
 * component:  Uncategorized => Core (Other)
 * resolution:   => duplicate


Comment:

 Duplicate of #30377.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.29ea81c8f29332a593f6b683f318f450%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30376: Saving ModelForm with missing, non-optional fields does not trigger a validation error

2019-04-17 Thread Django
#30376: Saving ModelForm with missing, non-optional fields does not trigger a
validation error
---+--
 Reporter:  Will Gordon|Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Documentation  |  Version:  master
 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:  0
---+--
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => invalid
 * version:  2.1 => master
 * component:  Uncategorized => Documentation


Comment:

 `ModelForm` doesn't take into account missing fields in both `clean()` and
 `save()` method, IMO it is expected behavior, see e.g.

 {{{
 Any fields not included in a form by the above logic will not be set by
 the form’s save() method.
 }}}

 `blank=True` is not related with a DB constraint (like e.g. `null=False`)
 that's why `IntegrityError` is also not raised by a DB.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6ccfdff9ab7318ba43425ca489633cb1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30378: AttributeError: 'NoneType' object has no attribute 'split'

2019-04-17 Thread Django
#30378: AttributeError: 'NoneType' object has no attribute 'split'
---+--
 Reporter:  PM |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Uncategorized  |  Version:  2.1
 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 PM:

Old description:

> I'm writing very simple code while learning Django. I noticed there is
> some error in the server console window sometimes when I refreshed my
> browser.
>
> The error always ends with the line in the ticket Summary. The following
> is the entire copy of the error.
> What the strange is everything works good except the error information.
> Nothing is broken. The view is always rendered properly. Also, this error
> doesn't always happen. It occurs occasionally. Any idea what it is mean?
>

> {{{
> [17/Apr/2019 14:52:40] "GET /favicon.ico HTTP/1.1" 404 2189
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 138, in run
> self.finish_response()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
> finish_response
> self.write(data)
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
> self.send_headers()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 332, in
> send_headers
> self.send_preamble()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 255, in
> send_preamble
> ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 453, in _write
> result = self.stdout.write(data)
>   File "C:\Python\Python37\lib\socketserver.py", line 799, in write
> self._sock.sendall(b)
> ConnectionAbortedError: [WinError 10053] An established connection was
> aborted by the software in your host machine
> [17/Apr/2019 14:52:40] "GET /favicon.ico HTTP/1.1" 500 59
> 
> Exception happened during processing of request from ('127.0.0.1', 55341)
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 138, in run
> self.finish_response()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
> finish_response
> self.write(data)
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
> self.send_headers()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 332, in
> send_headers
> self.send_preamble()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 255, in
> send_preamble
> ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 453, in _write
> result = self.stdout.write(data)
>   File "C:\Python\Python37\lib\socketserver.py", line 799, in write
> self._sock.sendall(b)
> ConnectionAbortedError: [WinError 10053] An established connection was
> aborted by the software in your host machine
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 141, in run
> self.handle_error()
>   File "C:\PythonCode\SeaMotor\venv\lib\site-
> packages\django\core\servers\basehttp.py", line 116, in handle_error
> super().handle_error()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 368, in
> handle_error
> self.finish_response()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
> finish_response
> self.write(data)
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
> self.send_headers()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 331, in
> send_headers
> if not self.origin_server or self.client_is_modern():
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 344, in
> client_is_modern
> return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
> TypeError: 'NoneType' object is not subscriptable
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\socketserver.py", line 650, in
> process_request_thread
> self.finish_request(request, client_address)
>   File "C:\Python\Python37\lib\socketserver.py", line 360, in
> finish_request
> self.RequestHandlerClass(request, client_address, self)
>   File "C:\Python\Python37\lib\socketserver.py", line 720, in __init__
> self.handle()
>   File "C:\PythonCode\SeaMotor\venv\lib\site-
> 

Re: [Django] #30378: AttributeError: 'NoneType' object has no attribute 'split'

2019-04-17 Thread Django
#30378: AttributeError: 'NoneType' object has no attribute 'split'
---+--
 Reporter:  PM |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Uncategorized  |  Version:  2.1
 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 PM:

Old description:

> I'm writing very simple code while learning Django. I noticed there is
> some error in the server console window sometimes when I refreshed my
> browser.
>
> The error always ends with the line in the ticket Summary. The following
> is the entire copy of the error.
> What the strange is everything works good except the error information.
> Nothing is broken. The view is always rendered properly. Any idea what it
> is mean?
>

> {{{
> [17/Apr/2019 14:52:40] "GET /favicon.ico HTTP/1.1" 404 2189
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 138, in run
> self.finish_response()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
> finish_response
> self.write(data)
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
> self.send_headers()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 332, in
> send_headers
> self.send_preamble()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 255, in
> send_preamble
> ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 453, in _write
> result = self.stdout.write(data)
>   File "C:\Python\Python37\lib\socketserver.py", line 799, in write
> self._sock.sendall(b)
> ConnectionAbortedError: [WinError 10053] An established connection was
> aborted by the software in your host machine
> [17/Apr/2019 14:52:40] "GET /favicon.ico HTTP/1.1" 500 59
> 
> Exception happened during processing of request from ('127.0.0.1', 55341)
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 138, in run
> self.finish_response()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
> finish_response
> self.write(data)
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
> self.send_headers()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 332, in
> send_headers
> self.send_preamble()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 255, in
> send_preamble
> ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 453, in _write
> result = self.stdout.write(data)
>   File "C:\Python\Python37\lib\socketserver.py", line 799, in write
> self._sock.sendall(b)
> ConnectionAbortedError: [WinError 10053] An established connection was
> aborted by the software in your host machine
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 141, in run
> self.handle_error()
>   File "C:\PythonCode\SeaMotor\venv\lib\site-
> packages\django\core\servers\basehttp.py", line 116, in handle_error
> super().handle_error()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 368, in
> handle_error
> self.finish_response()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
> finish_response
> self.write(data)
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
> self.send_headers()
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 331, in
> send_headers
> if not self.origin_server or self.client_is_modern():
>   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 344, in
> client_is_modern
> return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
> TypeError: 'NoneType' object is not subscriptable
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "C:\Python\Python37\lib\socketserver.py", line 650, in
> process_request_thread
> self.finish_request(request, client_address)
>   File "C:\Python\Python37\lib\socketserver.py", line 360, in
> finish_request
> self.RequestHandlerClass(request, client_address, self)
>   File "C:\Python\Python37\lib\socketserver.py", line 720, in __init__
> self.handle()
>   File "C:\PythonCode\SeaMotor\venv\lib\site-
> packages\django\core\servers\basehttp.py", line 171, in handle
> 

[Django] #30378: AttributeError: 'NoneType' object has no attribute 'split'

2019-04-17 Thread Django
#30378: AttributeError: 'NoneType' object has no attribute 'split'
-+
   Reporter:  PM |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Uncategorized  |Version:  2.1
   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  |
-+
 I'm writing very simple code while learning Django. I noticed there is
 some error in the server console window sometimes when I refreshed my
 browser.

 The error always ends with the line in the ticket Summary. The following
 is the entire copy of the error.
 What the strange is everything works good except the error information.
 Nothing is broken. The view is always rendered properly. Any idea what it
 is mean?


 {{{
 [17/Apr/2019 14:52:40] "GET /favicon.ico HTTP/1.1" 404 2189
 Traceback (most recent call last):
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 138, in run
 self.finish_response()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
 finish_response
 self.write(data)
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
 self.send_headers()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 332, in
 send_headers
 self.send_preamble()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 255, in
 send_preamble
 ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 453, in _write
 result = self.stdout.write(data)
   File "C:\Python\Python37\lib\socketserver.py", line 799, in write
 self._sock.sendall(b)
 ConnectionAbortedError: [WinError 10053] An established connection was
 aborted by the software in your host machine
 [17/Apr/2019 14:52:40] "GET /favicon.ico HTTP/1.1" 500 59
 
 Exception happened during processing of request from ('127.0.0.1', 55341)
 Traceback (most recent call last):
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 138, in run
 self.finish_response()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
 finish_response
 self.write(data)
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
 self.send_headers()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 332, in
 send_headers
 self.send_preamble()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 255, in
 send_preamble
 ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 453, in _write
 result = self.stdout.write(data)
   File "C:\Python\Python37\lib\socketserver.py", line 799, in write
 self._sock.sendall(b)
 ConnectionAbortedError: [WinError 10053] An established connection was
 aborted by the software in your host machine

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 141, in run
 self.handle_error()
   File "C:\PythonCode\SeaMotor\venv\lib\site-
 packages\django\core\servers\basehttp.py", line 116, in handle_error
 super().handle_error()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 368, in
 handle_error
 self.finish_response()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 180, in
 finish_response
 self.write(data)
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 274, in write
 self.send_headers()
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 331, in
 send_headers
 if not self.origin_server or self.client_is_modern():
   File "C:\Python\Python37\lib\wsgiref\handlers.py", line 344, in
 client_is_modern
 return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
 TypeError: 'NoneType' object is not subscriptable

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "C:\Python\Python37\lib\socketserver.py", line 650, in
 process_request_thread
 self.finish_request(request, client_address)
   File "C:\Python\Python37\lib\socketserver.py", line 360, in
 finish_request
 self.RequestHandlerClass(request, client_address, self)
   File "C:\Python\Python37\lib\socketserver.py", line 720, in __init__
 self.handle()
   File "C:\PythonCode\SeaMotor\venv\lib\site-
 packages\django\core\servers\basehttp.py", line 171, in handle
 self.handle_one_request()
   File "C:\PythonCode\SeaMotor\venv\lib\site-
 packages\django\core\servers\basehttp.py", line 194, in handle_one_request
 handler.run(self.server.get_app())
   File 

Re: [Django] #30342: Remove the LANGUAGES_BIDI<=LANGUAGES check

2019-04-17 Thread Django
#30342: Remove the LANGUAGES_BIDI<=LANGUAGES check
--+
 Reporter:  Matthias Kestenholz   |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Core (System checks)  |  Version:  master
 Severity:  Release blocker   |   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 Matthias Kestenholz):

 [https://github.com/django/django/pull/11244 PR]

 The pull request removes the system check and amends the `LANGUAGES_BIDI`
 description to make it clear that `LANGUAGES_BIDI` isn't supposed to be a
 subset of `LANGUAGES`.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.4a50dbea33baf2c776e14db608561315%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30374: Paginator UnorderedObjectListWarning on union(all=True) of two sorted queries

2019-04-17 Thread Django
#30374: Paginator UnorderedObjectListWarning on union(all=True) of two sorted
queries
-+-
 Reporter:  Rich Rauenzahn   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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:  0
-+-
Changes (by felixxm):

 * status:  new => closed
 * component:  Uncategorized => Database layer (models, ORM)
 * version:  1.11 => master
 * resolution:   => invalid


Comment:

 I agree that in your case all composed queries are ordered but the final
 query is not. To avoid this warning you can add `order_by()` to the final
 queryset, e.g.
 {{{#!python
 haves =
 
MyModel.objects.filter(foreign_relationship=4).order_by('foreign_relationship__value',
 'common_key')
 havenots = MyModel.objects.exclude(id__in=haves).order_by('common_key')
 query = haves.union(havenots, all=True).order_by('common_key')
 }}}

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.678c2c180674564eba12b755f85a9580%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30371: sqlmigrate fails with string defaults on mysql

2019-04-17 Thread Django
#30371: sqlmigrate fails with string defaults on mysql
-+-
 Reporter:  Melvyn Sopacua   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Release blocker  |   Resolution:  needsinfo
 Keywords:  regression   | 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):

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


Comment:

 I was unable to reproduce until now, we need more information, please.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.ba8c6a07ffa6e409d30cd18f2a06652b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.