Re: [Django] #30735: Testing client encode_multipart may also support dict format. (was: Testing client encode_multipart may also support dict format)

2019-08-29 Thread Django
#30735: Testing client encode_multipart may also support dict format.
-+-
 Reporter:  Yannick Chabbert |Owner:  Yannick
 |  Chabbert
 Type:  New feature  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  test | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by felixxm):

 * status:  assigned => closed
 * version:  2.2 => master
 * resolution:   => wontfix


Comment:

 Thanks for this report, however you cannot provide nested dicts because as
 far as I'm concerned it is not a RFC compliant. I don't think that Django
 should assume that users want to test JSON data. Moreover I don't see how
 DRF is limited by Django in this area, assertion that you pointed is
 rather a conscious choice.

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

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


Re: [Django] #30735: Testing client encode_multipart may also support dict format.

2019-08-29 Thread Django
#30735: Testing client encode_multipart may also support dict format.
-+-
 Reporter:  Yannick Chabbert |Owner:  Yannick
 |  Chabbert
 Type:  New feature  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  test | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 Aside: if you were to propose the adjustment here to DRF, we'd say
 something like, "subclass MultiPartRenderer to automatically convert dicts
 to JSON, if that's what you know you want for your project". I'd suggest
 that as a way forward, although, I'd probably advise just keeping the
 `json.dumps()` inline, since it's nicely visible there, and not much of a
 hardship... (HTH).

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

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


Re: [Django] #25367: Allow expressions in .filter() calls

2019-08-29 Thread Django
#25367: Allow expressions in .filter() calls
-+-
 Reporter:  Anssi Kääriäinen |Owner:  Matthew
 Type:   |  Schinckel
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

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


Comment:

 In [changeset:"4137fc2efce2dde48340728b8006fc6d66b9e3a5" 4137fc2e]:
 {{{
 #!CommitTicketReference repository=""
 revision="4137fc2efce2dde48340728b8006fc6d66b9e3a5"
 Fixed #25367 -- Allowed boolean expressions in QuerySet.filter() and
 exclude().

 This allows using expressions that have an output_field that is a
 BooleanField to be used directly in a queryset filters, or in the
 When() clauses of a Case() expression.

 Thanks Josh Smeaton, Tim Graham, Simon Charette, Mariusz Felisiak, and
 Adam Johnson for reviews.

 Co-Authored-By: NyanKiyoshi 
 }}}

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

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


Re: [Django] #30735: Testing client encode_multipart may also support dict format.

2019-08-29 Thread Django
#30735: Testing client encode_multipart may also support dict format.
-+-
 Reporter:  Yannick Chabbert |Owner:  Yannick
 |  Chabbert
 Type:  New feature  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  test | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Yannick Chabbert):

 Thanks for the quick answer. I agree with you and it clearly needs more
 search before suggesting an helper like this.

 What I'm still not sure and I still don't understand yet is why it works
 in real life (sending data dict as json string along with file)!!?
 * It is the DRF parser which '''magically''' detect that the string is a
 json format and thus, deserialize it?
 * Or it happen elsewhere, at a lower level in Django itself?
 * This parsing behaviour is wanted or just a side effect?
 * Afterall, even if it work, is it RFC compliant to send json data '''as
 string''' with multipart content type?

 The big deal to me is not really to have this helper just like for list or
 file (because finally, we could do it manually) but to understand why this
 exception is raised and if there is a good reason to do this? If true, it
 means that we '''should't''' do this and parser should be fixed to failed
 instead. Otherwise, exception shouldn't be raised and give an helper to
 dumps data as json at a lowest level in Django (that's why I open this
 issue in the Django project and not in DRF)...

 Indeed at the begining, I was thinking: "ok, test failed because an
 exception is raised to tell me it is not possible". Sad story but ok, this
 is it. But after discovering that it works in real life, I'm saying: "Oooh
 good catch! In fact, it works!! So this exception is maybe wrong??"

 I will try to investigate more deeply on it and give some feedbacks.

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

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


Re: [Django] #30735: Testing client encode_multipart may also support dict format.

2019-08-29 Thread Django
#30735: Testing client encode_multipart may also support dict format.
-+-
 Reporter:  Yannick Chabbert |Owner:  Yannick
 |  Chabbert
 Type:  New feature  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  test | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Yannick Chabbert):

 Replying to [comment:5 Carlton Gibson]:
 > Aside: if you were to propose the adjustment here to DRF, we'd say
 something like, "subclass MultiPartRenderer to automatically convert dicts
 to JSON, if that's what you know you want for your project". I'd suggest
 that as a way forward, although, I'd probably advise just keeping the
 `json.dumps()` inline, since it's nicely visible there, and not much of a
 hardship... (HTH).

 Didn't see your comment, good suggestion thanks !

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

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


Re: [Django] #30735: Testing client encode_multipart may also support dict format.

2019-08-29 Thread Django
#30735: Testing client encode_multipart may also support dict format.
-+-
 Reporter:  Yannick Chabbert |Owner:  Yannick
 |  Chabbert
 Type:  New feature  |   Status:  closed
Component:  Testing framework|  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  test | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Yannick Chabbert):

 Ok, I can confirm that it work because this is an expected behavior in
 DRF.

 Request is first parsed by the Django {{{MutiPartParser}}} which just
 extract the raw json string:
 
https://github.com/django/django/blob/master/django/http/multipartparser.py#L196

 It is then handled by the corresponding serializer field (DRF) by
 implementing the {{to_internal_value}} method.

 RFC compliant or not (I still didn't know but finally, a string is a
 string, no matter what it contains!), this is not an issue with Django and
 sorry for the bad report!

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

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


Re: [Django] #30066: UserManager.create_superuser doesn't allow for omitting email or password, unlike create_user which does.

2019-08-29 Thread Django
#30066: UserManager.create_superuser doesn't allow for omitting email or 
password,
unlike create_user which does.
-+-
 Reporter:  Joshua Cannon|Owner:  Daniel
 Type:   |  Rios
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  create_superuser | 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 Carlton Gibson):

 * version:  2.1 => master
 * stage:  Accepted => Ready for checkin


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

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


Re: [Django] #25367: Allow expressions in .filter() calls

2019-08-29 Thread Django
#25367: Allow expressions in .filter() calls
-+-
 Reporter:  Anssi Kääriäinen |Owner:  Matthew
 Type:   |  Schinckel
  Cleanup/optimization   |   Status:  closed
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"d275fd04f3fbb1a6cfa2273feb6cb414ce143b8c" d275fd04]:
 {{{
 #!CommitTicketReference repository=""
 revision="d275fd04f3fbb1a6cfa2273feb6cb414ce143b8c"
 Refs #25367 -- Simplified OrderBy and Lookup by using Case() instead of
 RawSQL() on Oracle.

 Follow up to efa1908f662c19038a944129c81462485c4a9fe8.
 }}}

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

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


Re: [Django] #30066: UserManager.create_superuser doesn't allow for omitting email or password, unlike create_user which does.

2019-08-29 Thread Django
#30066: UserManager.create_superuser doesn't allow for omitting email or 
password,
unlike create_user which does.
-+-
 Reporter:  Joshua Cannon|Owner:  Daniel
 Type:   |  Rios
  Cleanup/optimization   |   Status:  closed
Component:  contrib.auth |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  create_superuser | 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 Carlton Gibson ):

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


Comment:

 In [changeset:"b5a5c92c72cc179b5a9a888039cdd2f0680bff36" b5a5c92c]:
 {{{
 #!CommitTicketReference repository=""
 revision="b5a5c92c72cc179b5a9a888039cdd2f0680bff36"
 Fixed #30066 -- Enabled super user creation without email and password
 }}}

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

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


[Django] #30738: Misleading multiwidget template example

2019-08-29 Thread Django
#30738: Misleading multiwidget template example
-+
   Reporter:  Emmanuel Cazenave  |  Owner:  nobody
   Type:  Uncategorized  | Status:  new
  Component:  Documentation  |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  |
-+
 In
 
https://docs.djangoproject.com/en/2.2/ref/forms/widgets/#django.forms.MultiWidget.get_context
 the template given as an example includes the multiwidget template instead
 of including its sub-widget templates.

 Instead of :

 {{{
 {% for subwidget in widget.subwidgets %}
 {% include widget.template_name with widget=subwidget %}
 {% endfor %}
 }}}

 there should be :

 {{{
 {% for subwidget in widget.subwidgets %}
 {% include subwidget.template_name with widget=subwidget %}
 {% endfor %}
 }}}

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

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


[Django] #30739: OuterRef does not work with exclude() or ~Q()

2019-08-29 Thread Django
#30739: OuterRef does not work with exclude() or ~Q()
-+-
   Reporter:  Oskar  |  Owner:  nobody
  Persson|
   Type:  Bug| Status:  new
  Component:  Database   |Version:  2.2
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 The following test (added to `tests/queries/test_qs_combinators`) fails
 when trying to exclude results using OuterRef()


 {{{
 def test_exists_exclude(self):
 # filter()
 qs = Number.objects.annotate(
 foo=Exists(
 Item.objects.filter(tags__category_id=OuterRef('pk'))
 )
 ).filter(foo=True)
 print(qs)  # works

 # exclude()
 qs = Number.objects.annotate(
 foo =Exists(
 Item.objects.exclude(tags__category_id=OuterRef('pk'))
 )
 ).filter(foo=True)
 print(qs)  # crashes

 # filter(~Q())
 qs = Number.objects.annotate(
 foo =Exists(
 Item.objects.filter(~Q(tags__category_id=OuterRef('pk')))
 )
 ).filter(foo=True)
 print(qs)  # crashes
 }}}


 It results in the following error

 {{{
 ValueError: This queryset contains a reference to an outer query and may
 only be used in a subquery
 }}}

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

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


Re: [Django] #18763: Shortcut to get users by permission

2019-08-29 Thread Django
#18763: Shortcut to get users by permission
-+-
 Reporter:  Sergiy Kuzmenko  |Owner:  Nick Pope
 Type:  New feature  |   Status:  assigned
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 felixxm):

 * stage:  Accepted => Ready for checkin


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

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


Re: [Django] #29376: Allow hiding the "Save and Add Another" button with a `show_save_and_add_another` context variable

2019-08-29 Thread Django
#29376: Allow hiding the "Save and Add Another" button with a
`show_save_and_add_another` context variable
-+-
 Reporter:  Mihas|Owner:  Hasan
 Type:   |  Ramezani
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.admin|  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 Hasan Ramezani):

 * owner:  nobody => Hasan Ramezani
 * needs_better_patch:  1 => 0
 * status:  new => assigned
 * needs_tests:  1 => 0


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

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


[Django] #30740: collectstatic tries to connect to database

2019-08-29 Thread Django
#30740: collectstatic tries to connect to database
--+---
   Reporter:  PaszaVonPomiot  |  Owner:  nobody
   Type:  Bug | Status:  new
  Component:  GIS |Version:  2.1
   Severity:  Normal  |   Keywords:  collectstatic
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
  UI/UX:  0   |
--+---
 In models.py I have a model AbcRules with attribute that queries another
 model:

 {{{
 ASSIGN_CHOICES = [team for team in
 sorted(set(People.objects.all().values_list("SquadName", flat=True)))]

 }}}
 For some reason during collectstatic execution Django tries to connect to
 database which fails on RedHat. The same collectstatic command will work
 on Windows. The problem is somewhat similar to:
 https://code.djangoproject.com/ticket/17656
 and maybe
 https://code.djangoproject.com/ticket/23514


 {{{
 ---> Collecting Django static files ...
 Traceback (most recent call last):
   File "/opt/app-root/lib/python3.6/site-
 packages/django/db/backends/base/base.py", line 216, in ensure_connection
 self.connect()
   File "/opt/app-root/lib/python3.6/site-
 packages/django/db/backends/base/base.py", line 194, in connect
 self.connection = self.get_new_connection(conn_params)
   File "/opt/app-root/lib/python3.6/site-
 packages/sql_server/pyodbc/base.py", line 307, in get_new_connection
 timeout=timeout)
 pyodbc.OperationalError: ('HYT00', '[HYT00] [unixODBC][Microsoft][ODBC
 Driver 13 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
 The above exception was the direct cause of the following exception:
 Traceback (most recent call last):
   File "./manage.py", line 11, in 
 execute_from_command_line(sys.argv)
   File "/opt/app-root/lib/python3.6/site-
 packages/django/core/management/__init__.py", line 381, in
 execute_from_command_line
 utility.execute()
   File "/opt/app-root/lib/python3.6/site-
 packages/django/core/management/__init__.py", line 357, in execute
 django.setup()
   File "/opt/app-root/lib/python3.6/site-packages/django/__init__.py",
 line 24, in setup
 apps.populate(settings.INSTALLED_APPS)
   File "/opt/app-root/lib/python3.6/site-
 packages/django/apps/registry.py", line 112, in populate
 app_config.import_models()
   File "/opt/app-root/lib/python3.6/site-packages/django/apps/config.py",
 line 198, in import_models
 self.models_module = import_module(models_module_name)
   File "/opt/app-root/lib64/python3.6/importlib/__init__.py", line 126, in
 import_module
 return _bootstrap._gcd_import(name[level:], package, level)
   File "", line 994, in _gcd_import
   File "", line 971, in _find_and_load
   File "", line 955, in
 _find_and_load_unlocked
   File "", line 665, in _load_unlocked
   File "", line 678, in exec_module
   File "", line 219, in
 _call_with_frames_removed
   File "/opt/app-root/src/vs/models.py", line 1543, in 
 class AbcRules(models.Model):
   File "/opt/app-root/src/vs/models.py", line 1562, in TscmRules
 ASSIGN_CHOICES = [team for team in
 sorted(set(People.objects.all().values_list("SquadName", flat=True)))]
   File "/opt/app-root/lib/python3.6/site-
 packages/django/db/models/query.py", line 268, in __iter__
 self._fetch_all()
   File "/opt/app-root/lib/python3.6/site-
 packages/django/db/models/query.py", line 1186, in _fetch_all
 self._result_cache = list(self._iterable_class(self))
   File "/opt/app-root/lib/python3.6/site-
 packages/django/db/models/query.py", line 176, in __iter__
 for row in compiler.results_iter(chunked_fetch=self.chunked_fetch,
 chunk_size=self.chunk_size):
   File "/opt/app-root/lib/python3.6/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 "/opt/app-root/lib/python3.6/site-
 packages/django/db/models/sql/compiler.py", line 1052, in execute_sql
 sql, params = self.as_sql()
   File "/opt/app-root/lib/python3.6/site-
 packages/sql_server/pyodbc/compiler.py", line 176, in as_sql
 supports_offset_clause = self.connection.sql_server_version >= 2012
   File "/opt/app-root/lib/python3.6/site-
 packages/django/utils/functional.py", line 37, in __get__
 res = instance.__dict__[self.name] = self.func(instance)
   File "/opt/app-root/lib/python3.6/site-
 packages/sql_server/pyodbc/base.py", line 390, in sql_server_version
 with self.temporary_connection() as cursor:
   File "/opt/rh/rh-python36/root/usr/lib64/python3.6/contextlib.py", line
 81, in __enter__
 return next(self.gen)
   File "/opt/app-root/lib/python3.6/site-
 packages/django/db/back

[Django] #30741: Setting db_constraint=False to an existing column does not properly drop the constraint

2019-08-29 Thread Django
#30741: Setting db_constraint=False to an existing column does not properly drop
the constraint
-+-
   Reporter:  ses4j  |  Owner:  nobody
   Type: | Status:  new
  Uncategorized  |
  Component: |Version:  2.2
  Migrations |   Keywords:  db_constraint,
   Severity:  Normal |  migrations
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Repro steps, using PostgreSQL and Django 2.2.4:

 1. Create a new model with a normal, constrained ForeignKey, such as:

 {{{
 class Child(models.Model):
 parent = models.ForeignKey('myapp.Parent', related_name="+",
 on_delete=models.DO_NOTHING)
 }}}

 2. Create a migration: python manage.py makemigrations

 3. Add db_constraint=False, like so:

 {{{
 class Child(models.Model):
 parent = models.ForeignKey('myapp.Parent', related_name="+",
 on_delete=models.DO_NOTHING, db_constraint=False)
 }}}

 4. Create a second migration: python manage.py makemigrations

 5. Peep at the generated SQL.  The first migration creates the constraint,
 and the second fails to remove it:

 {{{
 (.env) c:\wc\dbconstraintnotdropped>python manage.py sqlmigrate myapp 0001
 BEGIN;
 --
 -- Create model Parent
 --
 CREATE TABLE "myapp_parent" ("id" serial NOT NULL PRIMARY KEY);
 --
 -- Create model Child
 --
 CREATE TABLE "myapp_child" ("id" serial NOT NULL PRIMARY KEY, "parent_id"
 integer NOT NULL);
 ALTER TABLE "myapp_child" ADD CONSTRAINT
 "myapp_child_parent_id_af46d0ab_fk_myapp_parent_id" FOREIGN KEY
 ("parent_id") REFERENCES "myapp_parent" ("id") DEFERRABLE INITIALLY
 DEFERRED;
 CREATE INDEX "myapp_child_parent_id_af46d0ab" ON "myapp_child"
 ("parent_id");
 COMMIT;

 (.env) c:\wc\dbconstraintnotdropped>python manage.py sqlmigrate myapp 0002
 BEGIN;
 --
 -- Alter field submission on child
 --
 COMMIT;
 }}}

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

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


Re: [Django] #30741: Setting db_constraint=False to an existing column does not properly drop the constraint

2019-08-29 Thread Django
#30741: Setting db_constraint=False to an existing column does not properly drop
the constraint
-+-
 Reporter:  Scott Stafford   |Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Migrations   |  Version:  2.2
 Severity:  Normal   |   Resolution:
 Keywords:  db_constraint,   | Triage Stage:
  migrations |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Scott Stafford:

Old description:

> Repro steps, using PostgreSQL and Django 2.2.4:
>
> 1. Create a new model with a normal, constrained ForeignKey, such as:
>
> {{{
> class Child(models.Model):
> parent = models.ForeignKey('myapp.Parent', related_name="+",
> on_delete=models.DO_NOTHING)
> }}}
>
> 2. Create a migration: python manage.py makemigrations
>
> 3. Add db_constraint=False, like so:
>
> {{{
> class Child(models.Model):
> parent = models.ForeignKey('myapp.Parent', related_name="+",
> on_delete=models.DO_NOTHING, db_constraint=False)
> }}}
>
> 4. Create a second migration: python manage.py makemigrations
>
> 5. Peep at the generated SQL.  The first migration creates the
> constraint, and the second fails to remove it:
>
> {{{
> (.env) c:\wc\dbconstraintnotdropped>python manage.py sqlmigrate myapp
> 0001
> BEGIN;
> --
> -- Create model Parent
> --
> CREATE TABLE "myapp_parent" ("id" serial NOT NULL PRIMARY KEY);
> --
> -- Create model Child
> --
> CREATE TABLE "myapp_child" ("id" serial NOT NULL PRIMARY KEY, "parent_id"
> integer NOT NULL);
> ALTER TABLE "myapp_child" ADD CONSTRAINT
> "myapp_child_parent_id_af46d0ab_fk_myapp_parent_id" FOREIGN KEY
> ("parent_id") REFERENCES "myapp_parent" ("id") DEFERRABLE INITIALLY
> DEFERRED;
> CREATE INDEX "myapp_child_parent_id_af46d0ab" ON "myapp_child"
> ("parent_id");
> COMMIT;
>
> (.env) c:\wc\dbconstraintnotdropped>python manage.py sqlmigrate myapp
> 0002
> BEGIN;
> --
> -- Alter field submission on child
> --
> COMMIT;
> }}}

New description:

 Repro steps, using PostgreSQL and Django 2.2.4:

 1. Create a new model with a normal, constrained ForeignKey, such as:

 {{{
 class Child(models.Model):
 parent = models.ForeignKey('myapp.Parent', related_name="+",
 on_delete=models.DO_NOTHING)
 }}}

 2. Create a migration: python manage.py makemigrations

 3. Add db_constraint=False, like so:

 {{{
 class Child(models.Model):
 parent = models.ForeignKey('myapp.Parent', related_name="+",
 on_delete=models.DO_NOTHING, db_constraint=False)
 }}}

 4. Create a second migration: python manage.py makemigrations

 5. Peep at the generated SQL.  The first migration creates the constraint,
 and the second fails to remove it:

 {{{
 (.env) c:\wc\dbconstraintnotdropped>python manage.py sqlmigrate myapp 0001
 BEGIN;
 --
 -- Create model Parent
 --
 CREATE TABLE "myapp_parent" ("id" serial NOT NULL PRIMARY KEY);
 --
 -- Create model Child
 --
 CREATE TABLE "myapp_child" ("id" serial NOT NULL PRIMARY KEY, "parent_id"
 integer NOT NULL);
 ALTER TABLE "myapp_child" ADD CONSTRAINT
 "myapp_child_parent_id_af46d0ab_fk_myapp_parent_id" FOREIGN KEY
 ("parent_id") REFERENCES "myapp_parent" ("id") DEFERRABLE INITIALLY
 DEFERRED;
 CREATE INDEX "myapp_child_parent_id_af46d0ab" ON "myapp_child"
 ("parent_id");
 COMMIT;

 (.env) c:\wc\dbconstraintnotdropped>python manage.py sqlmigrate myapp 0002
 BEGIN;
 --
 -- Alter field submission on child
 --
 COMMIT;
 }}}

 Presumably related to the changes made on ticket:23264.

--

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

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


Re: [Django] #30731: simplify_regexp() doesn't replace trailing groups.

2019-08-29 Thread Django
#30731: simplify_regexp() doesn't replace trailing groups.
-+-
 Reporter:  Alan Crosswell   |Owner:  Alan
 |  Crosswell
 Type:  Bug  |   Status:  assigned
Component:  contrib.admindocs|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Alan Crosswell):

 See PR [[https://github.com/django/django/pull/11728|11728]]

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

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


Re: [Django] #30740: collectstatic tries to connect to database

2019-08-29 Thread Django
#30740: collectstatic tries to connect to database
-+-
 Reporter:  PaszaVonPomiot   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  contrib.staticfiles  |  Version:  2.1
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  collectstatic| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

 * status:  new => closed
 * resolution:   => invalid
 * component:  GIS => contrib.staticfiles


Comment:

 I would say that querying the database at module import time is a very bad
 idea, so you should find a different way to populate your choices
 attribute (the choices might be better suited at the form level).

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

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


Re: [Django] #30731: simplify_regexp() doesn't replace trailing groups.

2019-08-29 Thread Django
#30731: simplify_regexp() doesn't replace trailing groups.
-+-
 Reporter:  Alan Crosswell   |Owner:  Alan
 |  Crosswell
 Type:  Bug  |   Status:  assigned
Component:  contrib.admindocs|  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):

 * has_patch:  0 => 1


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

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


Re: [Django] #30738: Misleading multiwidget template example. (was: Misleading multiwidget template example)

2019-08-29 Thread Django
#30738: Misleading multiwidget template example.
--+
 Reporter:  Emmanuel Cazenave |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  2.2
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  1 |UI/UX:  0
--+
Changes (by felixxm):

 * stage:  Unreviewed => Accepted
 * type:  Uncategorized => Cleanup/optimization
 * easy:  0 => 1


Comment:

 Thanks for the report. Agreed, this typo should be fixed.

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

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


Re: [Django] #3888: Allow {# comment #} tag to be multiline

2019-08-29 Thread Django
#3888: Allow {# comment #} tag to be multiline
-+-
 Reporter:  Artem Skoretskiy |Owner:  Adrian
 |  Holovaty
 Type:  Uncategorized|   Status:  closed
Component:  Template system  |  Version:  master
 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 maxelem):

 * ui_ux:   => 0
 * type:   => Uncategorized
 * severity:   => Normal
 * easy:   => 0


Comment:

 [https://bobhoney.com/ bob honey who just do stuff]

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

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


Re: [Django] #8559: new comment.get_absolute_url returns ''

2019-08-29 Thread Django
#8559: new comment.get_absolute_url returns ''
---+
 Reporter:  TrevorFSmith   |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Documentation  |  Version:  master
 Severity:  Normal |   Resolution:  fixed
 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 maxelem):

 * ui_ux:   => 0
 * type:   => Uncategorized
 * severity:   => Normal
 * easy:   => 0


Comment:

 [https://bobhoney.com/ bob honey who just do stuff]

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

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


Re: [Django] #30739: OuterRef in exclude() or ~Q() uses wrong model. (was: OuterRef does not work with exclude() or ~Q())

2019-08-29 Thread Django
#30739: OuterRef in exclude() or ~Q() uses wrong model.
-+-
 Reporter:  Oskar Persson|Owner:  nobody
 Type:  Bug  |   Status:  new
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):

 * cc: Simon Charette (added)
 * version:  2.2 => master
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the report. `ValueError` was fixed in
 35431298226165986ad07e91f9d3aca721ff38ec. Provided test fails on master
 with
 {{{
 django.db.utils.ProgrammingError: missing FROM-clause entry for table "V0"
 LINE 1: ...(U1."tag_id" = U2."id") WHERE U2."category_id" = ("V0"."id")...
 }}}
 It looks that `OuterRef` resolves to `"V0"."id"` instead of
 `"queries_number"."id"`
 {{{
 SELECT ...
 FROM "queries_number"
 WHERE EXISTS(
 SELECT ...
 FROM "queries_item" V0
 WHERE NOT (V0."id" IN (
 SELECT U1."item_id"
 FROM "queries_item_tags" U1 INNER JOIN "queries_tag" U2 ON
 (U1."tag_id" = U2."id")
 WHERE U2."category_id" = "V0"."id"
 ))
 }}}
 Issue can be reproduce also without annotation
 {{{
 
Number.objects.filter(Exists(Item.objects.exclude(tags__category_id=OuterRef('pk'
 }}}

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

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