Re: [Django] #30436: on_delete attribute must be callable. (was: ForeignKey on_delete parameter should be validated)

2019-05-05 Thread Django
#30436: on_delete attribute must be callable.
-+-
 Reporter:  Rémy Hubscher|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  master
  (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 felixxm):

 * component:  Uncategorized => Database layer (models, ORM)
 * version:  2.2 => master
 * type:  Uncategorized => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the report. I can imagine that someone may provide custom
 `on_delete` behavior, hence I don't think we should validate this
 attribute with a static list of `on_delete` behaviors defined by Django.
 IMO we can raise
 {{{
 raise ValueError('on_delete must be callable.')
 }}}
 in `__init__()`.

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


Re: [Django] #30445: RunSQL Migration should accept psycogp2 sql.Composable object. (was: RunSQL Migration should accept psycogp2 sql.Composable object)

2019-05-05 Thread Django
#30445: RunSQL Migration should accept psycogp2 sql.Composable object.
-+-
 Reporter:  suomenusko   |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Migrations   |  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  RunSQL   | Triage Stage:
  sql.Composable |  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
 * version:  2.2 => master
 * resolution:   => wontfix


Comment:

 Thanks for the report, however this is
 [https://docs.djangoproject.com/en/stable/ref/migration-operations/#runsql
 documented] behavior:
 > sql, and reverse_sql if provided, should be strings of SQL to run on the
 database. On most database backends (all but PostgreSQL), ...

 I don't think that we should add any complexity here. If you want to use
 `psycopg2.sql.Composable` you can always do this via `RunPython()`.

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


Re: [Django] #30411: Improve traceback formatting in technical 500 text responses

2019-05-05 Thread Django
#30411: Improve traceback formatting in technical 500 text responses
-+-
 Reporter:  Daniel Hahler|Owner:  Daniel
 Type:   |  Hahler
  Cleanup/optimization   |   Status:  assigned
Component:  Error reporting  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by felixxm):

 * owner:  Naved Khan => Daniel Hahler
 * has_patch:  0 => 1
 * version:  2.2 => master


Comment:

 [https://github.com/django/django/pull/11287 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/065.a05f406eac04ab5c66f964892d2ea33f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30443: Negative durations are displayed counterintuitively. (was: Negative durations are displayed counterintuitively)

2019-05-05 Thread Django
#30443: Negative durations are displayed counterintuitively.
-+-
 Reporter:  Ryan Govostes|Owner:  (none)
 Type:  New feature  |   Status:  closed
Component:  Utilities|  Version:  master
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  DurationField,   | Triage Stage:  Accepted
  duration, timedelta|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * status:  new => closed
 * version:  2.2 => master
 * easy:  1 => 0
 * ui_ux:  1 => 0
 * resolution:   => duplicate


Comment:

 Duplicate of #26317.

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


[Django] #30448: close_if_unusable_or_obsolete should skip connections in atomic block for autocommit check

2019-05-05 Thread Django
#30448: close_if_unusable_or_obsolete should skip connections in atomic block 
for
autocommit check
-+-
   Reporter:  Daniel |  Owner:  nobody
  Hahler |
   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  |
-+-
 Via https://github.com/django/channels/issues/1091#issuecomment-489488831
 I have noticed that `close_if_unusable_or_obsolete` will close the DB
 connection used in tests, which has entered an atomic block (via
 `TestCase`).

 channel's `DatabaseSyncToAsync` calls `close_if_unusable_or_obsolete`
 here.

 The following patch might make sense:

 {{{
 diff --git c/django/db/backends/base/base.py
 i/django/db/backends/base/base.py
 index 9fa03cc0ee..f9ca0f8464 100644
 --- c/django/db/backends/base/base.py
 +++ i/django/db/backends/base/base.py
 @@ -497,7 +497,10 @@ def close_if_unusable_or_obsolete(self):
  if self.connection is not None:
  # If the application didn't restore the original autocommit
 setting,
  # don't take chances, drop the connection.
 -if self.get_autocommit() != self.settings_dict['AUTOCOMMIT']:
 +if (
 +not self.in_atomic_block and
 +self.get_autocommit() !=
 self.settings_dict["AUTOCOMMIT"]
 +):
  self.close()
  return

 }}}

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


Re: [Django] #30446: Automatically resolve Value's output_field for stdlib types. (was: SerachVectorField cannot be updated with pure string)

2019-05-05 Thread Django
#30446: Automatically resolve Value's output_field for stdlib types.
-+-
 Reporter:  Ozan Gerdaneri   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  SearchVector,| Triage Stage:  Accepted
  SearchVectorField , Value  |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Simon Charette):

 * type:  Bug => Cleanup/optimization
 * stage:  Unreviewed => Accepted


Comment:

 Specifying an explicit `output_field` for `Value` should resolve your
 issue.

 {{{#!python
 value = Value(
 "a string to be indexed and inserted to search_vector field",
 output_field=models.TextField(),
 )
 AModel.objects.filter(pk=1).update(
 search_vector=SearchVector(value),
 )
 }}}

 I guess `Value._resolve_output_field` could be made smarter for some
 stdlib types such as `str`, `float`, `int`, `Decimal`, `date`, `datetime`
 so I'm tentatively accepting on this basis.

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


Re: [Django] #30444: Refactor `BaseDatabaseSchemaEditor.create_model`

2019-05-05 Thread Django
#30444: Refactor `BaseDatabaseSchemaEditor.create_model`
-+-
 Reporter:  Rob Golding  |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  master
  (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 Simon Charette):

 * stage:  Unreviewed => Accepted


Comment:

 That sounds like a reasonable improvement.

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


Re: [Django] #30447: Add is_in_european_union to GeoIP2.city dict

2019-05-05 Thread Django
#30447: Add is_in_european_union to GeoIP2.city dict
-+--
 Reporter:  c23gooey |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  GIS  |  Version:  2.2
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Description changed by c23gooey:

Old description:

> Maxmind data supplies european union information as part of both the free
> and paid database sets.
>
> This isn't accessible from the GeoIP2 city dict, despite it being
> available.

New description:

 Maxmind data supplies european union information as part of both the free
 and paid database sets.

 This isn't accessible from the GeoIP2 city dict, despite it being
 available.

 PR on GitHub = https://github.com/django/django/pull/11327

--

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


[Django] #30447: Add is_in_european_union to GeoIP2.city dict

2019-05-05 Thread Django
#30447: Add is_in_european_union to GeoIP2.city dict
---+
   Reporter:  c23gooey |  Owner:  nobody
   Type:  New feature  | Status:  new
  Component:  GIS  |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|
---+
 Maxmind data supplies european union information as part of both the free
 and paid database sets.

 This isn't accessible from the GeoIP2 city dict, despite it being
 available.

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


Re: [Django] #30446: SerachVectorField cannot be updated with pure string (was: SerachVectorField cannot be updated pure string)

2019-05-05 Thread Django
#30446: SerachVectorField cannot be updated with pure string
-+-
 Reporter:  Ozan Gerdaneri   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  2.2
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  SearchVector,| Triage Stage:
  SearchVectorField , Value  |  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/063.fd34b0cae628b8ae0df274c44db75542%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30446: SerachVectorField cannot be updated pure string

2019-05-05 Thread Django
#30446: SerachVectorField cannot be updated pure string
-+-
   Reporter:  Ozan   |  Owner:  nobody
  Gerdaneri  |
   Type:  Bug| Status:  new
  Component:  Database   |Version:  2.2
  layer (models, ORM)|   Keywords:  SearchVector,
   Severity:  Normal |  SearchVectorField , Value
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Hi,
 I have a model of AModel. AModel has a SearchVectorField named
 search_vector. I want to update this vector by indexing a string that is
 not in any other field.


 {{{
 from django.db.models import Value
 from django.contrib.postgres.search import SearchVector

 AModel.objects.filter(pk=1).update(search_vector=SearchVector(Value("a
 string to be indexed and inserted to search_vector field")))

 }}}

 This code generates this error:

 {{{

 FieldError: Cannot resolve expression type, unknown output_field
 }}}

 It seemed to be a bug since I found similar usages in forums..

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


[Django] #30445: RunSQL Migration should accept psycogp2 sql.Composable object

2019-05-05 Thread Django
#30445: RunSQL Migration should accept psycogp2 sql.Composable object
-+-
   Reporter: |  Owner:  nobody
  suomenusko |
   Type:  New| Status:  new
  feature|
  Component: |Version:  2.2
  Migrations |   Keywords:  RunSQL
   Severity:  Normal |  sql.Composable
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Generally, if we want to run raw SQL in the code, you do it the context of
 a cursor. If you have psycopg2 as your DB backend, in addition to passing
 cursor.execute a string, you can also pass an sql.Composable object, and
 it'll work.

 However, if you are doing a RunSQL migration, you cannot use these, since
 the BaseDatabaseSchemaEditor execute method assumes it is a string (?).
 Specifically, it tries to explicitly casts it to a string, before passing
 sql to the cursor's execute. It  seems like the line is there to account
 for non string objects, but str() won't convert Composable objects to the
 SQL statement correctly.

 I'm not sure how reasonable it is to fix this, especially since I'm not
 too sure what collect_sql should be doing (it looks like sql being a
 string is pretty ingrained in the logic), and it's easy enough to fix this
 yourself by subclassing RunSQL, and calling the Composable's as_string
 method, but it seems like the schema editor's execute method should be
 agnostic towards the type you pass in, since all it really does is call
 the cursor's execute. With that said, I think it's fair to say this is
 more of a new feature than a 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/053.b0c7806e99441a83b8178717cfbfd484%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30444: Refactor `BaseDatabaseSchemaEditor.create_model`

2019-05-05 Thread Django
#30444: Refactor `BaseDatabaseSchemaEditor.create_model`
-+-
   Reporter:  Rob|  Owner:  nobody
  Golding|
   Type: | Status:  new
  Cleanup/optimization   |
  Component:  Database   |Version:  master
  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  |
-+-
 I've been working on a project that uses Citus as the database (which is a
 Postgres database extension). I found it easy to override methods to
 change most of the behaviour in the `BaseDatabaseSchemaEditor` class, but
 the `create_model` functionality differs in that it directly executes SQL
 which it generates itself.

 I propose extracting this logic into a `table_sql` method, similar to how
 `column_sql` works.

 I'm happy to submit a PR for this work if it sounds like a reasonable
 improvement!

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


Re: [Django] #28519: Add filter(), exclude(), and other base QuerySet methods to combined QuerySets (union(), etc.)

2019-05-05 Thread Django
#28519: Add filter(), exclude(), and other base QuerySet methods to combined
QuerySets (union(), etc.)
-+-
 Reporter:  Stanislav Karpov |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  union,   | Triage Stage:  Accepted
  intersection, difference   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by harrim4n):

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


Re: [Django] #30439: ngettext broken for certain locales due to catalog merging

2019-05-05 Thread Django
#30439: ngettext broken for certain locales due to catalog merging
-+-
 Reporter:  Michal Čihař |Owner:  Claude
 |  Paroz
 Type:  Bug  |   Status:  assigned
Component:   |  Version:  2.2
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Michal Čihař):

 I was thinking about something like this:

 {{{
   class DjangoTranslation:
 def __init__(language, domain='django', localedirs=None):
 self.domain = domain
 self.translations = []
 # Here would be rest of init logic based on current code

 def merge(self, other):
 if not isinstance(other, NullTranslations):
 self.translations.append(other)

 def gettext(message):
 for translation in self.translations:
 tmsg = translation._catalog.get(message, None)
 if tmsg is not None:
 return tmsg
 return message
 }}}

 It would perform slightly worse than current code especially in case there
 will be many apps with locales.

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


Re: [Django] #28519: Add filter(), exclude(), and other base QuerySet methods to combined QuerySets (union(), etc.)

2019-05-05 Thread Django
#28519: Add filter(), exclude(), and other base QuerySet methods to combined
QuerySets (union(), etc.)
-+-
 Reporter:  Stanislav Karpov |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  union,   | Triage Stage:  Accepted
  intersection, difference   |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by harrim4n):

 Until (if) this is implemented, I suggest adding a check when .get(),
 .filter() etc. are called on such a QS. Currently the error messages (if
 there are any) do not explain the issue, the only way to find out about
 this is in the documentation of the QS API, section union().

 Example:
 {{{
 qs1 = User.objects.all()
 qs2 = User.objects.filter(username="nonexistant")
 qs3 = qs1.difference(qs2)
 print(qs1)
 print(qs2)
 print(qs3)
 print(qs1.get(id=1))
 print(qs3.get(id=1))
 }}}

 This fails with (could be any number instead of 4, of course)
 {{{
 MultipleObjectsReturned: get() returned more than one User -- it returned
 4!
 }}}

 Even worse, if the difference of qs1 and qs2 only contains one element,
 this element is returned when calling qs3.get(id=1) without any error
 message, even though the objects ID is not 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/063.db897accf0a8cd68c1797859232537b7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30443: Negative durations are displayed counterintuitively

2019-05-05 Thread Django
#30443: Negative durations are displayed counterintuitively
-+-
 Reporter:  Ryan Govostes|Owner:  (none)
 Type:  New feature  |   Status:  new
Component:  Utilities|  Version:  2.2
 Severity:  Normal   |   Resolution:
 Keywords:  DurationField,   | Triage Stage:  Accepted
  duration, timedelta|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-

Comment (by udbhavgovil):

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

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


Re: [Django] #30443: Negative durations are displayed counterintuitively

2019-05-05 Thread Django
#30443: Negative durations are displayed counterintuitively
-+-
 Reporter:  Ryan Govostes|Owner:  (none)
 Type:  New feature  |   Status:  new
Component:  Utilities|  Version:  2.2
 Severity:  Normal   |   Resolution:
 Keywords:  DurationField,   | Triage Stage:  Accepted
  duration, timedelta|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by udbhavgovil):

 * status:  assigned => new
 * owner:  udbhavgovil => (none)


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


Re: [Django] #30443: Negative durations are displayed counterintuitively

2019-05-05 Thread Django
#30443: Negative durations are displayed counterintuitively
-+-
 Reporter:  Ryan Govostes|Owner:
 |  udbhavgovil
 Type:  New feature  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Normal   |   Resolution:
 Keywords:  DurationField,   | Triage Stage:  Accepted
  duration, timedelta|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by udbhavgovil):

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


Re: [Django] #30443: Negative durations are displayed counterintuitively

2019-05-05 Thread Django
#30443: Negative durations are displayed counterintuitively
-+-
 Reporter:  Ryan Govostes|Owner:
 |  udbhavgovil
 Type:  New feature  |   Status:  assigned
Component:  Utilities|  Version:  2.2
 Severity:  Normal   |   Resolution:
 Keywords:  DurationField,   | Triage Stage:
  duration, timedelta|  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  1
-+-
Changes (by udbhavgovil):

 * status:  new => assigned
 * owner:  nobody => udbhavgovil


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