Re: [Django] #28643: Complete the ORM Function Library

2019-01-08 Thread Django
#28643: Complete the ORM Function Library
-+-
 Reporter:  Matthew Pava |Owner:  Nick Pope
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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 Nick Pope:

Old description:

> I was surprised to learn that we didn't have a StrIndex function until
> version 2, and yet we had Substr since at least version 1.8.  I wonder
> how users were using Substr without also finding a use for StrIndex this
> whole time.  Anyway, since we seem to be adding these functions one at a
> time, why don't we work on trying to get the built-ins implemented in one
> sweep instead?
>
> We may even want to split the documentation page
> (https://docs.djangoproject.com/en/dev/ref/models/database-functions/)
> into further categories with String functions and Numeric functions.
>
> This is just a sample checklist, with corresponding attributes to which
> backend has them available.
>
> = **Comparison** =||
> ||**Django**||**SQL**||**Description**||**PostgreSQL**||**Oracle**||**MySQL**||**SQLite**||**PR**||
> ||{{{NullIf}}}||{{{NULLIF}}}||Returns {{{NULL}}} if the first argument
> equals the
> second.||‎✔||‎✔||‎✔||‎✔||[https://github.com/django/django/pull/9543
> 9543]||
> = **Math** =||
> ||**Django**||**SQL**||**Description**||**PostgreSQL**||**Oracle**||**MySQL**||**SQLite**||**PR**||
> ||{{{Abs}}}||{{{ABS}}}||Returns the absolute
> value.||‎✔||‎✔||‎✔||‎✔||~~9622~~||
> ||{{{ACos}}}||{{{ACOS}}}||Returns the
> arccosine.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{ASin}}}||{{{ASIN}}}||Returns the
> arcsine.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{ATan}}}||{{{ATAN}}}||Returns the
> arctangent.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{ATan2}}}||{{{ATAN2}}}||Returns the arctangent of the two variables
> passed to it.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Ceil}}}||{{{CEILING}}}||Returns the smallest integer value that is
> not less than a numeric
> expression||‎✔||{{{CEIL}}}||‎✔||✔**^1^**||~~9622~~||
> ||{{{Cos}}}||{{{COS}}}||Returns the cosine expressed in
> radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Cot}}}||{{{COT}}}||Returns the
> cotangent.||‎✔||‎✔**^5^**||‎✔||✔**^1^**||~~9622~~||
> ||{{{Degrees}}}||{{{DEGREES}}}||Returns a numeric expression converted
> from radians to degrees.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Exp}}}||{{{EXP}}}||Returns the base of the natural logarithm (e)
> raised to the power of a numeric
> expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Floor}}}||{{{FLOOR}}}||Returns the largest integer value that is not
> greater than a numeric expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Ln}}}||{{{LN}}}||Returns the natural logarithm of a numeric
> expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Log}}}||{{{LOG(B, X)}}}||Returns the logarithm of a numeric
> expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Mod}}}||{{{MOD}}}||Returns the remainder of one expression by diving
> by another expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Pi}}}||{{{PI}}}||Returns the value of
> π||‎✔||✔**^4^**||‎✔||✔**^1^**||~~9622~~||
> ||{{{Power}}}||{{{POWER}}}||Returns the value of one expression raised to
> the power of another expression||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Radians}}}||{{{RADIANS}}}||Returns the value of an expression
> converted from degrees to radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Round}}}||{{{ROUND}}}||Returns a numeric expression rounded to an
> integer.\\Can be used to round an expression to a number of decimal
> points||‎✔||‎✔||‎✔||‎✔||~~9622~~||
> ||{{{Sin}}}||{{{SIN}}}||Returns the sine given in
> radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Sqrt}}}||{{{SQRT}}}||Returns the square
> root.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Tan}}}||{{{TAN}}}||Returns the tangent expressed in
> radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> = **Text** =||
> ||**Django**||**SQL**||**Description**||**PostgreSQL**||**Oracle**||**MySQL**||**SQLite**||**PR**||
> ||{{{Ord}}}||{{{ASCII}}}||Returns numeric value of left-most character.
> (Equivalent to {{{ord()}}} in
> Python.)||‎✔||‎✔||‎✔||{{{UNICODE}}}||~~9583~~||
> ||{{{Chr}}}||{{{CHR}}}||Character with the given
> code||‎✔||‎✔||{{{CHAR}}}||{{{CHAR}}}||~~9583~~||
> ||{{{Left}}}||{{{LEFT}}}||Returns the leftmost number of characters as
> specified||‎✔||✔**^2, 6^**||‎✔||✔**^2^**||~~9583~~||
> 

Re: [Django] #28643: Complete the ORM Function Library

2019-01-08 Thread Django
#28643: Complete the ORM Function Library
-+-
 Reporter:  Matthew Pava |Owner:  Nick Pope
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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
-+-

Old description:

> I was surprised to learn that we didn't have a StrIndex function until
> version 2, and yet we had Substr since at least version 1.8.  I wonder
> how users were using Substr without also finding a use for StrIndex this
> whole time.  Anyway, since we seem to be adding these functions one at a
> time, why don't we work on trying to get the built-ins implemented in one
> sweep instead?
>
> We may even want to split the documentation page
> (https://docs.djangoproject.com/en/dev/ref/models/database-functions/)
> into further categories with String functions and Numeric functions.
>
> This is just a sample checklist, with corresponding attributes to which
> backend has them available.
>
> = **Comparison** =||
> ||**Django**||**SQL**||**Description**||**PostgreSQL**||**Oracle**||**MySQL**||**SQLite**||**PR**||
> ||{{{NullIf}}}||{{{NULLIF}}}||Returns {{{NULL}}} if the first argument
> equals the
> second.||‎✔||‎✔||‎✔||‎✔||[https://github.com/django/django/pull/9543
> 9543]||
> = **Math** =||
> ||**Django**||**SQL**||**Description**||**PostgreSQL**||**Oracle**||**MySQL**||**SQLite**||**PR**||
> ||{{{Abs}}}||{{{ABS}}}||Returns the absolute
> value.||‎✔||‎✔||‎✔||‎✔||~~9622~~||
> ||{{{ACos}}}||{{{ACOS}}}||Returns the
> arccosine.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{ASin}}}||{{{ASIN}}}||Returns the
> arcsine.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{ATan}}}||{{{ATAN}}}||Returns the
> arctangent.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{ATan2}}}||{{{ATAN2}}}||Returns the arctangent of the two variables
> passed to it.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Ceil}}}||{{{CEILING}}}||Returns the smallest integer value that is
> not less than a numeric
> expression||‎✔||{{{CEIL}}}||‎✔||✔**^1^**||~~9622~~||
> ||{{{Cos}}}||{{{COS}}}||Returns the cosine expressed in
> radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Cot}}}||{{{COT}}}||Returns the
> cotangent.||‎✔||‎✔**^5^**||‎✔||✔**^1^**||~~9622~~||
> ||{{{Degrees}}}||{{{DEGREES}}}||Returns a numeric expression converted
> from radians to degrees.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Exp}}}||{{{EXP}}}||Returns the base of the natural logarithm (e)
> raised to the power of a numeric
> expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Floor}}}||{{{FLOOR}}}||Returns the largest integer value that is not
> greater than a numeric expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Ln}}}||{{{LN}}}||Returns the natural logarithm of a numeric
> expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Log}}}||{{{LOG(B, X)}}}||Returns the logarithm of a numeric
> expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Mod}}}||{{{MOD}}}||Returns the remainder of one expression by diving
> by another expression.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Pi}}}||{{{PI}}}||Returns the value of
> π||‎✔||✔**^4^**||‎✔||✔**^1^**||~~9622~~||
> ||{{{Power}}}||{{{POWER}}}||Returns the value of one expression raised to
> the power of another expression||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Radians}}}||{{{RADIANS}}}||Returns the value of an expression
> converted from degrees to radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Round}}}||{{{ROUND}}}||Returns a numeric expression rounded to an
> integer.\\Can be used to round an expression to a number of decimal
> points||‎✔||‎✔||‎✔||‎✔||~~9622~~||
> ||{{{Sin}}}||{{{SIN}}}||Returns the sine given in
> radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Sqrt}}}||{{{SQRT}}}||Returns the square
> root.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> ||{{{Tan}}}||{{{TAN}}}||Returns the tangent expressed in
> radians.||‎✔||‎✔||‎✔||✔**^1^**||~~9622~~||
> = **Text** =||
> ||**Django**||**SQL**||**Description**||**PostgreSQL**||**Oracle**||**MySQL**||**SQLite**||**PR**||
> ||{{{Ord}}}||{{{ASCII}}}||Returns numeric value of left-most character.
> (Equivalent to {{{ord()}}} in
> Python.)||‎✔||‎✔||‎✔||{{{UNICODE}}}||~~9583~~||
> ||{{{Chr}}}||{{{CHR}}}||Character with the given
> code||‎✔||‎✔||{{{CHAR}}}||{{{CHAR}}}||~~9583~~||
> ||{{{Left}}}||{{{LEFT}}}||Returns the leftmost number of characters as
> specified||‎✔||✔**^2, 6^**||‎✔||✔**^2^**||~~9583~~||
> ||{{{LPad}}}||{{{LPAD}}}||Returns the string argument, 

Re: [Django] #28643: Complete the ORM Function Library

2019-01-08 Thread Django
#28643: Complete the ORM Function Library
-+-
 Reporter:  Matthew Pava |Owner:  Nick Pope
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 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 Nick Pope):

 * owner:  JunyiJ => Nick Pope
 * needs_better_patch:  1 => 0


Comment:

 I have added a new [https://github.com/django/django/pull/10764 PR] that
 cleans up some of the compatibility mixins added as part of the math
 function work so that they can be reused.
 It also makes use of these mixins for aggregates defined in
 `django.db.models.aggregates`.

-- 
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.93903a78d5dc16e53d2c2f4930d7882b%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-01-08 Thread Django
#29139: Aggregate functions failing when using Postgres JSON field KeyTransform
-+-
 Reporter:  trik |Owner:  ddio
 Type:  Bug  |   Status:  assigned
Component:  contrib.postgres |  Version:  2.0
 Severity:  Normal   |   Resolution:
 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 Tim Graham):

 I closed #29139 as a duplicate but that could be confirmed if a patch is
 provided.

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


Re: [Django] #30085: Aggregate functions crash when using Postgres JSON field KeyTransform (was: Postgres query to Django ORM)

2019-01-08 Thread Django
#30085: Aggregate functions crash when using Postgres JSON field KeyTransform
-+-
 Reporter:  keyloguer|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  contrib.postgres |  Version:  2.1
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  Django ORM, QUERY,   | Triage Stage:
  Postgresql |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * status:  new => closed
 * resolution:   => duplicate
 * component:  Database layer (models, ORM) => contrib.postgres


Comment:

 Looks like a duplicate of #29139. The traceback is similar. Feel free to
 reopen if it looks like a different issue to you.

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


Re: [Django] #30085: Postgres query to Django ORM

2019-01-08 Thread Django
#30085: Postgres query to Django ORM
-+-
 Reporter:  keyloguer|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  Django ORM, QUERY,   | Triage Stage:
  Postgresql |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by keyloguer):

 * type:  Uncategorized => Bug


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


[Django] #30085: Postgres query to Django ORM

2019-01-08 Thread Django
#30085: Postgres query to Django ORM
-+-
   Reporter:  keyloguer  |  Owner:  nobody
   Type: | Status:  new
  Uncategorized  |
  Component:  Database   |Version:  2.1
  layer (models, ORM)|   Keywords:  Django ORM, QUERY,
   Severity:  Normal |  Postgresql
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 I want to do this query bellow in django orm, i've tried to do with the
 queryset example and it doesn't work, always returns the error, i want to
 know if is possible to solve this.
 I think the problem migth be GROUP BY, and the Django ORM doens't do the
 GROUP BY, but this it is just a guess.

 error:

 {{{
 Traceback (most recent call last):
   File "C:\Python35\lib\site-
 packages\django\core\handlers\exception.py", line 34, in inner
 response = get_response(request)
   File "C:\Python35\lib\site-packages\django\core\handlers\base.py",
 line 126, in _get_response
 response = self.process_exception_by_middleware(e, request)
   File "C:\Python35\lib\site-packages\django\core\handlers\base.py",
 line 124, in _get_response
 response = wrapped_callback(request, *callback_args,
 **callback_kwargs)
   File "C:\Python35\lib\site-
 packages\django\views\decorators\csrf.py", line 54, in wrapped_view
 return view_func(*args, **kwargs)
   File "C:\Python35\lib\site-packages\rest_framework\viewsets.py",
 line 116, in view
 return self.dispatch(request, *args, **kwargs)
   File "C:\Python35\lib\site-packages\rest_framework\views.py", line
 495, in dispatch
 response = self.handle_exception(exc)
   File "C:\Python35\lib\site-packages\rest_framework\views.py", line
 455, in handle_exception
 self.raise_uncaught_exception(exc)
   File "C:\Python35\lib\site-packages\rest_framework\views.py", line
 492, in dispatch
 response = handler(request, *args, **kwargs)
   File "C:\Python35\lib\site-packages\drf_multiple_model\mixins.py",
 line 112, in list
 data = query_data['serializer_class'](queryset, many=True,
 context=context).data
   File "C:\Python35\lib\site-packages\rest_framework\serializers.py",
 line 765, in data
 ret = super(ListSerializer, self).data
   File "C:\Python35\lib\site-packages\rest_framework\serializers.py",
 line 262, in data
 self._data = self.to_representation(self.instance)
   File "C:\Python35\lib\site-packages\rest_framework\serializers.py",
 line 683, in to_representation
 self.child.to_representation(item) for item in iterable
   File "C:\Python35\lib\site-packages\django\db\models\query.py", line
 268, in __iter__
 self._fetch_all()
   File "C:\Python35\lib\site-packages\django\db\models\query.py", line
 1186, in _fetch_all
 self._result_cache = list(self._iterable_class(self))
   File "C:\Python35\lib\site-packages\django\db\models\query.py", line
 106, in __iter__
 for row in compiler.results_iter(chunked_fetch=self.chunked_fetch,
 chunk_size=self.chunk_size):
   File "C:\Python35\lib\site-
 packages\django\db\models\sql\compiler.py", line 1017, in results_iter
 results = self.execute_sql(MULTI, chunked_fetch=chunked_fetch,
 chunk_size=chunk_size)
   File "C:\Python35\lib\site-
 packages\django\db\models\sql\compiler.py", line 1052, in execute_sql
 sql, params = self.as_sql()
   File "C:\Python35\lib\site-
 packages\django\db\models\sql\compiler.py", line 449, in as_sql
 extra_select, order_by, group_by = self.pre_sql_setup()
   File "C:\Python35\lib\site-
 packages\django\db\models\sql\compiler.py", line 55, in pre_sql_setup
 group_by = self.get_group_by(self.select + extra_select, order_by)
   File "C:\Python35\lib\site-
 packages\django\db\models\sql\compiler.py", line 130, in get_group_by
 if (sql, tuple(params)) not in seen:
 TypeError: unhashable type: 'list'
 }}}


 Postgres query:

 {{{

 SELECT (Count(jsonb(conversa->'parse_data'->'intent'->'name'))) as
 quantidade,
jsonb(conversa->'parse_data'->'intent'->'name') as intent,
to_char(data,'Mon') as mon
 FROM conversas
 where conversa->'text' is not null and conversa->'parse_data' is not
 null
 group by intent, mon
 }}}



 Django ORM:

 Repository:


 {{{
 queryset =
 Conversas.objects.extra(select={'mon':"to_char(data,'Mon')"}
 ).filter(conversa__text__isnull=False,
 conversa__parse_data__isnull=False,
   

Re: [Django] #23748: inspectdb should introspect autofield

2019-01-08 Thread Django
#23748: inspectdb should introspect autofield
-+-
 Reporter:  Paul Dejean  |Owner:  Nick Pope
 Type:  New feature  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  inspectdb| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Nick Pope):

 * owner:  nobody => Nick Pope
 * 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/069.28aa5a074a9f119377a7700b9f2bd1b1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23748: inspectdb should introspect autofield

2019-01-08 Thread Django
#23748: inspectdb should introspect autofield
-+-
 Reporter:  Paul Dejean  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  inspectdb| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * has_patch:  0 => 1


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

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


Re: [Django] #30052: QuerySet.only() doesn't support annotations

2019-01-08 Thread Django
#30052: QuerySet.only() doesn't support annotations
-+-
 Reporter:  Kal Sze  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (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 Tim Graham):

 I'm not sure. Please test `only()` without arguments. If it works, it
 might be worth adding tests for (if not already in Django's tests) and
 documenting.

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


Re: [Django] #30083: Model instance state not correctly set when initializing a model with Model.from_db() (was: Model instance state not correctly set when initializing a model with from_db)

2019-01-08 Thread Django
#30083: Model instance state not correctly set when initializing a model with
Model.from_db()
-+-
 Reporter:  Tirzono  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


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


Re: [Django] #30053: Allow for conditional QuerySet.update_or_create()

2019-01-08 Thread Django
#30053: Allow for conditional QuerySet.update_or_create()
-+-
 Reporter:  Joshua Cannon|Owner:  Nasir
 |  Hussain
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  QuerySet | Triage Stage:
  update_or_create   |  Unreviewed
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:   => wontfix


Comment:

 I don't see a consensus on the mailing list discussion to move forward
 with this.

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


Re: [Django] #30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause Django to use an in-memory database as expected

2019-01-08 Thread Django
#30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause
Django to use an in-memory database as expected
---+--
 Reporter:  mrts   |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  2.1
 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 Tim Graham):

 * status:  new => closed
 * component:  Uncategorized => Testing framework
 * type:  Uncategorized => Bug
 * resolution:   => invalid


Comment:

 `'ENGINE'` [https://docs.djangoproject.com/en/dev/topics/testing/overview
 /#the-test-database isn't a supported option] in `'TEST'`:
   Aside from using a separate database, the test runner will otherwise use
 all of the same database settings you have in your settings file: ENGINE,
 USER, HOST, etc.

 You should use a separate settings file when testing if you want to use a
 different database backend.

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


Re: [Django] #20147: Provide an alternative to request.META for accessing HTTP headers

2019-01-08 Thread Django
#20147: Provide an alternative to request.META for accessing HTTP headers
---+---
 Reporter:  Luke Plant |Owner:  santiagobasulto
 Type:  New feature|   Status:  assigned
Component:  HTTP handling  |  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 Tim Graham):

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


Re: [Django] #30080: New optional settings - disable bulk_create in all managers and call self.full_clean() before saving the models

2019-01-08 Thread Django
#30080: New optional settings - disable bulk_create in all managers and call
self.full_clean() before saving the models
-+-
 Reporter:  אורי |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * status:  new => closed
 * resolution:   => wontfix
 * component:  Uncategorized => Database layer (models, ORM)


Comment:

 [https://groups.google.com/d/topic/django-
 developers/nv7TldZ_qQI/discussion django-developers discussion]. Aymeric
 suggested that these feature requests are too niche and I agree.

 In the future, please limit tickets to one idea.

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


Re: [Django] #30075: Better error message for "App 'bar.foo' could not be found. Is it in INSTALLED_APPS?"

2019-01-08 Thread Django
#30075: Better error message for "App 'bar.foo' could not be found. Is it in
INSTALLED_APPS?"
-+-
 Reporter:  Sven R. Kunze|Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Core (Management |  Version:  1.11
  commands)  |
 Severity:  Normal   |   Resolution:  fixed
 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 Tim Graham):

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


Comment:

 On master:
 {{{
 $ python manage.py makemigrations bar.foo
 No installed app with label 'bar.foo'. Did you mean 'foo'?
 }}}

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


Re: [Django] #30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause Django to use an in-memory database as expected

2019-01-08 Thread Django
#30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause
Django to use an in-memory database as expected
---+--
 Reporter:  mrts   |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
---+--

Comment (by mrts):

 There is a workaround documented here:

 https://stackoverflow.com/a/3098182/258772

 But this is complex and fragile.

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


Re: [Django] #30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause Django to use an in-memory database as expected (was: Setting DATABASES['default']['TEST']['engine'] to SQL

2019-01-08 Thread Django
#30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause
Django to use an in-memory database as expected
---+--
 Reporter:  mrts   |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
---+--

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


[Django] #30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause Django to use an in-memory database if DATABASES['default']['NAME'] is given

2019-01-08 Thread Django
#30084: Setting DATABASES['default']['TEST']['engine'] to SQLite does not cause
Django to use an in-memory database if DATABASES['default']['NAME'] is
given
-+
   Reporter:  mrts   |  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  |
-+
 == Preconditions

 Given the following settings:

 {{{
 DATABASES = {
 'default': {
 'ENGINE': 'django.db.backends.postgresql_psycopg2',
 'NAME': 'database',
 ...
 'TEST': {
 'ENGINE': 'django.db.backends.sqlite3',
 }
 }
 }
 }}}


 == Actual

 When I run `./manage.py test` in a restricted environment, then I get the
 following error:

 {{{
 $ ./manage.py test
 Creating test database for alias 'default'...
 Got an error creating the test database: permission denied to create
 database

 Type 'yes' if you would like to try deleting the test database
 'test_database', or 'no' to cancel: yes
 Destroying old test database 'default'...
 Got an error recreating the test database: database "test_database" does
 not exist
 }}}

 == Expected

 The documentation says:

 > The default test database names are created by prepending `test_` to the
 value of each NAME in DATABASES. When using SQLite, the tests will use an
 in-memory database by default (i.e., the database will be created in
 memory, bypassing the filesystem entirely!).


 Thus, my expectation was that setting
 `DATABASES['default']['TEST']['engine']` to SQLite will use an in-memory
 database.

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


Re: [Django] #30052: QuerySet.only() doesn't support annotations

2019-01-08 Thread Django
#30052: QuerySet.only() doesn't support annotations
-+-
 Reporter:  Kal Sze  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (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 Kal Sze):

 Replying to [comment:1 Tim Graham]:
 > As far as I tested, annotations don't need to be included in `only()` in
 order to be included in the query. The documentation for `only()` and
 `defer()` only discuss using it with fields, not with annotations.

 I know it doesn't need to be included, but I thought the point of `only()`
 and `defer()` is to exclude the fields that we are not interested in, when
 executing the initial database query. Having `only()` support annotations
 is useful if I'm only interested in the annotated field, and not in the
 regular fields.

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

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


Re: [Django] #30081: Translation with context - makemessages doesn't recognize the context

2019-01-08 Thread Django
#30081: Translation with context - makemessages doesn't recognize the context
-+-
 Reporter:  אורי |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Core (Management |  Version:  1.11
  commands)  |
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Claude Paroz):

 Oh, looks like you already have a (almost?) working setup, then. I guess
 you could use a pgettext alias in the "real" code, because you don't need
 gettext extracting your strings in the code.
 Feel free to poke me privately if you need some counsel, but unfortunately
 I still don't see a common enough use case here to warrant a modification
 in Django itself.

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