Re: [Django] #30188: Aggregate annotation, Case() - When(): AssertionError No exception message supplied

2019-03-08 Thread Django
#30188: Aggregate annotation, Case() - When(): AssertionError No exception 
message
supplied
-+-
 Reporter:  Lukas Klement|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  query, aggregate,| Triage Stage:  Accepted
  case/when  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 The assertion error is addressed by
 https://github.com/django/django/pull/11062 but it unveiled another issue
 regarding aggregation over annotations.

 I managed to get it to work by adjusting the ''hacky''
 `Query.rewrite_cols` function but then I noticed the subquery was
 annotated twice which might hurt performance. I guess the suggested
 approach at least works and the double annotation issue seems to be
 generalized anyway. I suggest we open a following ticket to address the
 `rewrite_cols` extra annotation issue and proceed with the current
 approach for now.

-- 
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/070.2007064e5dda40b3b80db1aecff8342b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30226: Add base authentication backend to ease custom backend creation.

2019-03-08 Thread Django
#30226: Add base authentication backend to ease custom backend creation.
-+
 Reporter:  Tobias Bengfort  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  contrib.auth |  Version:  master
 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
-+
Description changed by Tobias Bengfort:

Old description:

> Currently, writing a new authentication backend requires quite some
> boilerplate e.g. `has_perm()` can be derived from `get_all_permissions()`
> which in turn can be derived from `get_user_permissions()` and
> `get_group_permissions()`. Additionally, `authenticate()` and
> `get_user()` should always return `None` for backends that only handle
> permissions.
>
> Also note that `get_all_permissions()` and `get_group_permissions()`
> exist on the User model, but `get_user_permissions()` does not. I think
> this is confisuing for backend authors.
>
> Mailinglist thread: https://groups.google.com/forum/#!topic/django-
> developers/CNmz22gEsCc
> Pull request: https://github.com/django/django/pull/11037

New description:

 Currently, writing a new authentication backend requires quite some
 boilerplate e.g. `has_perm()` can be derived from `get_all_permissions()`
 which in turn can be derived from `get_user_permissions()` and
 `get_group_permissions()`. Additionally, `authenticate()` and `get_user()`
 should always return `None` for backends that only handle permissions.

 Also note that `get_all_permissions()` and `get_group_permissions()` exist
 on the User model, but `get_user_permissions()` does not. I think this is
 confusing for backend authors.

 Mailinglist thread: https://groups.google.com/forum/#!topic/django-
 developers/CNmz22gEsCc
 Pull request: https://github.com/django/django/pull/11037

--

-- 
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/060.297090025339e184811a7e56ea65e771%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30226: Add base authentication backend to ease custom backend creation.

2019-03-08 Thread Django
#30226: Add base authentication backend to ease custom backend creation.
-+
 Reporter:  Tobias Bengfort  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  contrib.auth |  Version:  master
 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 Tobias Bengfort):

 * needs_better_patch:  1 => 0


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To 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/060.dcbe63ebae2cee79c342fc293a7398b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30226: Add base authentication backend to ease custom backend creation.

2019-03-08 Thread Django
#30226: Add base authentication backend to ease custom backend creation.
-+-
 Reporter:  Tobias Bengfort  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Accepted => Ready for checkin


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To 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/060.e317ed6c83811e37ee8476980307b1b6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30186: Show applied datetime in showmigrations

2019-03-08 Thread Django
#30186: Show applied datetime in showmigrations
-+-
 Reporter:  Timothy Schilling|Owner:  Timothy
 |  Schilling
 Type:  New feature  |   Status:  closed
Component:  Core (Management |  Version:  master
  commands)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  migrations   | Triage Stage:  Ready for
  showmigrations |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"7c68cea7ee406fcb1b632e3a1a7f6f53e1423839" 7c68cea]:
 {{{
 #!CommitTicketReference repository=""
 revision="7c68cea7ee406fcb1b632e3a1a7f6f53e1423839"
 Fixed #30186 -- Made showmigrations --list display the applied datetimes
 at verbosity 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/069.1d3a5bd070a597bb2b2417223ab15ccb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30188: Aggregate annotation, Case() - When(): AssertionError No exception message supplied

2019-03-08 Thread Django
#30188: Aggregate annotation, Case() - When(): AssertionError No exception 
message
supplied
-+-
 Reporter:  Lukas Klement|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  query, aggregate,| Triage Stage:  Accepted
  case/when  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1


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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To 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/070.4b79084e45eb5566d42c0c5b48552918%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30226: Add base authentication backend to ease custom backend creation.

2019-03-08 Thread Django
#30226: Add base authentication backend to ease custom backend creation.
-+
 Reporter:  Tobias Bengfort  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1


Comment:

 I left a few comments on the PR. When they're addressed, good to go.

-- 
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/060.bcf3640eb95aaacd65d3882d4754e524%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #21703: `exclude` query with `F` object across relationship fails

2019-03-08 Thread Django
#21703: `exclude` query with `F` object across relationship fails
-+-
 Reporter:  anonymous|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.6
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * needs_tests:  0 => 1


Comment:

 Addressed by https://github.com/django/django/pull/11062

-- 
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.15ab15822809d75d418b96f826f1cae4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30243: Reduce structural dependency in contrib.admin 'has_file_field' checks

2019-03-08 Thread Django
#30243: Reduce structural dependency in contrib.admin 'has_file_field' checks
+--
   Reporter:  btknu |  Owner:  btknu
   Type:  Cleanup/optimization  | Status:  assigned
  Component:  contrib.admin |Version:  master
   Severity:  Normal|   Keywords:
   Triage Stage:  Unreviewed|  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  1
  UI/UX:  0 |
+--
 This ticket is about a very small cleanup. It's possible that a Trac
 ticket isn't necessary for this, I decided to make one to stay on the safe
 side.

 The PR https://github.com/django/django/pull/9298 for ticket
 https://code.djangoproject.com/ticket/28585 adds code:

 {{{
 'has_file_field': context['adminform'].form.is_multipart() or
 any(
 admin_formset.formset.form().is_multipart()
 for admin_formset in context['inline_admin_formsets']
 ),
 }}}

 This snippet invokes `is_multipart()` on formset's `form()` object.
 But the formset (specifically: `BaseFormSet`) already provides an
 `is_multipart()` method.

 It feels cleaner to rely on a single place to calculate `is_multipart` for
 a formset.
 This way if `is_multipart` logic gets more complex, we only need to update
 it in one place and there's less risk of bugs.

 I suggest replacing:

 {{{
 admin_formset.formset.form().is_multipart()
 }}}

 with:

 {{{
 admin_formset.formset.is_multipart()
 }}}

-- 
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/048.25993afa64f0737c9cc38ea4f12afcd1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30152: MySQL: "Cannot change column 'id': used in a foreign key constraint" when altering pk of model with ForeignKey to self

2019-03-08 Thread Django
#30152: MySQL: "Cannot change column 'id': used in a foreign key constraint" 
when
altering pk of model with ForeignKey to self
---+
 Reporter:  Carsten Fuchs  |Owner:  Dart
 Type:  Bug|   Status:  assigned
Component:  Migrations |  Version:  2.2
 Severity:  Normal |   Resolution:
 Keywords:  mysql  | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Matthijs Kooijman):

 I ran into this issue myself this week and spent some time debugging it
 before I found this report. What I've found is that when changing the id
 field, MySQL/MariaDB complains if any constraints still reference the
 field. The
 
[[https://github.com/django/django/blob/1b8a26efa2e45ac471c969791e8c977e6d633091/django/db/backends/base/schema.py#L533|`_alter_field()`
 method]] works around this by looking for reverse (incoming) ForeignKey
 relations (which will have an associated constraint), dropping the
 constraint before changing the id field and recreating the constraints
 afterwards. As Carsten has found, this works fine for normal ForeignKeys,
 but not for the ForeignKeys implicitly created by a ManyToMany relation.

 Note that this problem does not occur when the ManyToMany relation uses an
 explicit `through` model, since then the relevant `ForeignKey` relations
 are explicit and will be treated just like all others.

 > I wonder why _alter_field() skips m2m fields at all?

 I've wondered this as well, and tried modifying the code to process m2m
 fields (e.g. let
 
[[https://github.com/django/django/blob/1b8a26efa2e45ac471c969791e8c977e6d633091/django/db/backends/base/schema.py#L14|`is_relevant_relation()`]]
 return `True` for m2m relations. However, further on, the code that has to
 actually process these "relevant relations" does not know how to handle
 m2m relation, so it throws some exception.

 However, I realized that it is not actually the m2m relation that needs to
 be processed, but the underlying implicit ForeignKey (or the resulting
 ManyToOneRel, really). When looking for relevant relations, the code
 
[[https://github.com/django/django/blob/1b8a26efa2e45ac471c969791e8c977e6d633091/django/db/backends/base/schema.py#L30-L36|uses
 `_meta.related_objects`]]. When an explicit `through` model is involved,
 this will include the ManyToOneRels pointing to that model and everything
 works. However, with an implicit `through` model, these relations are not
 even returned by `related_objects`, so there's nothing we can do inside
 `is_relevant_relation()` to fix this.

 Looking
 
[[https://github.com/django/django/blob/1b8a26efa2e45ac471c969791e8c977e6d633091/django/db/models/options.py#L550-L564|inside
 `related_objects`]] I see that it filters out hidden relations (except for
 m2m relations). Some debug printing shows that the relations that we need
 are in fact hidden. So replacing `related_objects` by
 `_get_fields(forward=False, reverse=True, include_hidden=True)` actually
 seems to fix this problem. This is of course an internal API which, I
 think, is not acceptable to use outside of the object itself, but I could
 not find any other public API to return exactly this (we could use
 `get_fields()`, but that has no way to only return reverse fields and not
 forward fields, so that needs additional filtering). Perhaps there is a
 better fix anyway?

 I'm attaching a patch that makes the above change to fix the problem (as
 stated, this is not a proper fix yet), but also adds a testcase that
 exposes this problem. I've found the `
 migrations.test_operations.OperationTests.test_alter_field_pk_fk` test
 which essentially tests this case, but with an incoming ForeignKey field.
 I ended up copying this test twice, once with an incoming m2m field with
 an explicit `through` model (which works already) and one with an implicit
 `through` model (which breaks when used without the fixes in my patch).
 The patch was made against 2.2b1 rather than master, since I didn't have
 any easy access to python3.6, but I think 2.2 should be similar enough.

 I also tried running all migration tests with this rough fix applied, but
 it seems that the testsuite already errors out on a clean checkout on my
 MySQL setup (sqlite seems to work). With the fix applied, the number of
 failing tests seems to stay the same, so that sounds promising (I haven't
 tried running the full test suite yet, though).

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

-- 
You received this message because you are 

Re: [Django] #30188: Aggregate annotation, Case() - When(): AssertionError No exception message supplied

2019-03-08 Thread Django
#30188: Aggregate annotation, Case() - When(): AssertionError No exception 
message
supplied
-+-
 Reporter:  Lukas Klement|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  query, aggregate,| Triage Stage:  Accepted
  case/when  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Can Sarıgöl):

 Thanks for that. This is a better solution.

-- 
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/070.69dd15b5c360089ca8cf943dbb6d3923%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30152: MySQL: "Cannot change column 'id': used in a foreign key constraint" when altering pk of model with ForeignKey to self

2019-03-08 Thread Django
#30152: MySQL: "Cannot change column 'id': used in a foreign key constraint" 
when
altering pk of model with ForeignKey to self
---+
 Reporter:  Carsten Fuchs  |Owner:  Dart
 Type:  Bug|   Status:  assigned
Component:  Migrations |  Version:  2.2
 Severity:  Normal |   Resolution:
 Keywords:  mysql  | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Matthijs Kooijman):

 * Attachment "testcase_and_rough_fix.patch" added.

 Testcase showing the problem, plus a rough stab at a fix

-- 
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.663647aa74327e03e85bb0207ab48aea%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30152: MySQL: "Cannot change column 'id': used in a foreign key constraint" when altering pk referenced by ManyToMany relation (was: MySQL: "Cannot change column 'id': used in a foreign

2019-03-08 Thread Django
#30152: MySQL: "Cannot change column 'id': used in a foreign key constraint" 
when
altering pk referenced by ManyToMany relation
---+
 Reporter:  Carsten Fuchs  |Owner:  Dart
 Type:  Bug|   Status:  assigned
Component:  Migrations |  Version:  2.2
 Severity:  Normal |   Resolution:
 Keywords:  mysql  | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Matthijs Kooijman):

 * cc: Matthijs Kooijman (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/066.e46f4bc70e7b7d96bfd913d3f87e5506%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30188: Aggregate annotation, Case() - When(): AssertionError No exception message supplied

2019-03-08 Thread Django
#30188: Aggregate annotation, Case() - When(): AssertionError No exception 
message
supplied
-+-
 Reporter:  Lukas Klement|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  query, aggregate,| Triage Stage:  Accepted
  case/when  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Can Sarıgöl):

 Can we fix twice annotated problem in here? I thought that we can remove
 the expr if it is already in annotations ({{{expr == old_expr}}})


 {{{
 elif isinstance(expr, (Col, Subquery)) or (expr.contains_aggregate and not
 expr.is_summary):
  ...
  new_exprs.append(Ref(col_alias, expr))
  if isinstance(expr, Subquery):
  keys = {
  k for k, old_expr in self.annotations.items()
  if k.startswith('__col') is False and expr == old_expr
   }
  for _k in keys:
  del self.annotations[_k]
 }}}

-- 
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/070.690a153383c4ae8f16b0933b8de4f8f5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30244: Aggregate functions with filter have bug with state mutation in get_source_expressions() method

2019-03-08 Thread Django
#30244: Aggregate functions with filter have bug with state mutation in
get_source_expressions() method
-+-
   Reporter:  gtors  |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Database   |Version:  2.1
  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  |
-+-
 Django 2.1.7

 {{{
 In [27]: s = Sum('x', filter=Q(x=1))

 In [28]: s.get_source_expressions()
 Out[28]: [F(x), ]

 In [29]: s.get_source_expressions()
 Out[29]: [F(x), , ]

 In [30]: s.get_source_expressions()
 Out[30]: [F(x), , , ]
 }}}

 Each call of `get_source_expressions` on instance of aggregate function
 causes list element duplication.

-- 
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/048.2c182c87a74c4d070fc1a738cf058d24%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30243: Reduce structural dependency in contrib.admin 'has_file_field' checks

2019-03-08 Thread Django
#30243: Reduce structural dependency in contrib.admin 'has_file_field' checks
-+-
 Reporter:  btknu|Owner:  btknu
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  contrib.admin|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Simon Charette):

 * stage:  Unreviewed => 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.0ebad4be45c7e784e762e6cc4194b0c2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30188: Aggregate annotation, Case() - When(): AssertionError No exception message supplied

2019-03-08 Thread Django
#30188: Aggregate annotation, Case() - When(): AssertionError No exception 
message
supplied
-+-
 Reporter:  Lukas Klement|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  query, aggregate,| Triage Stage:  Accepted
  case/when  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 Can, I guess we could somehow but I feel like we'd need a more elegant
 solution than that.

 Note that the double annotation issue doesn't only happen for subqueries,
 you might have noticed that the `company_id` which is first annotated as
 `Col0` gets annotated as `__col0` as well. This makes me believe we might
 need to do it for `Col` instances as well?

-- 
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/070.c93ceb044c4c4a5191f3461dfec94acc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30188: Aggregate annotation, Case() - When(): AssertionError No exception message supplied

2019-03-08 Thread Django
#30188: Aggregate annotation, Case() - When(): AssertionError No exception 
message
supplied
-+-
 Reporter:  Lukas Klement|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  query, aggregate,| Triage Stage:  Accepted
  case/when  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 I just pushed another commit that addresses the double aliasing issue. I
 credited you in the commit message Can.

-- 
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/070.31681289d9236b1f81bdf5ba5c09159e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30243: Reduce structural dependency in contrib.admin 'has_file_field' checks

2019-03-08 Thread Django
#30243: Reduce structural dependency in contrib.admin 'has_file_field' checks
-+-
 Reporter:  btknu|Owner:  btknu
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  contrib.admin|  Version:  master
 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:  1|UI/UX:  0
-+-
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"7c3a8b9db2ccfbb247732ce6726ab8dc11eff34d" 7c3a8b9]:
 {{{
 #!CommitTicketReference repository=""
 revision="7c3a8b9db2ccfbb247732ce6726ab8dc11eff34d"
 Fixed #30243 -- Simplified ModelAdmin.render_change_form()'s
 has_file_field.
 }}}

-- 
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.3895c6c3468680bb02110714427b6744%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #17345: Allow ordering override on ManyToManyField

2019-03-08 Thread Django
#17345: Allow ordering override on ManyToManyField
-+-
 Reporter:  FunkyBob |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  m2m, ordering| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Asif Saifuddin Auvi):

 * version:  1.3 => 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/066.9e2581bd915fdcd2ff8b98b0e6c4b9d1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-03-08 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 Carlton Gibson):

 * cc: Carlton Gibson (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.f1763bd818ef50d79190aa956e43c7d6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30242: Double spaces before limit/offset clause in as_sql() of SQLCompiler

2019-03-08 Thread Django
#30242: Double spaces before limit/offset clause in as_sql() of SQLCompiler
-+-
 Reporter:  hangpark |Owner:  hangpark
 Type:   |   Status:  assigned
  Cleanup/optimization   |
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  sql  | Triage Stage:  Ready for
  databaseoperations sqlcompiler |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Unreviewed => Ready for checkin


Comment:

 OK, given that you've patched this striaght-away, very happy to accept.
 Looks good.
 (Welcome aboard!)

-- 
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.9a412f798b9c9bd35b4f907d26b926f4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.