[Django] #33144: 'get_elided_page_range' method doesn't work properly

2021-09-25 Thread Django
#33144: 'get_elided_page_range' method doesn't work properly
-+-
   Reporter:  axinterop  |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Generic|Version:  3.2
  views  |   Keywords:  paginator,
   Severity:  Normal |  pagination, get_elided_page_range,
   Triage Stage: |  ListView
  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 I found that the page number is not passed to the
 ''get_elided_page_range'' method and it uses the default value (1) all the
 time.

 Having, for example, 34 pages, ''get_elided_page_range'' will always
 return ''1 2 3 4 … 33 34'' range **regardless** of the current page
 number.

 **views.py**
 {{{
 class TopicListView(ListView):
 model = Topic
 context_object_name = 'topics'
 template_name = 'topics.html'
 paginate_by = 3

 def get_context_data(self, *, object_list=None, **kwargs):
 context = super().get_context_data(**kwargs)
 context['board'] = self.board
 return context

 def get_queryset(self):
 self.board = get_object_or_404(Board,
 id=self.kwargs.get('board_id'))
 queryset = self.board.topics.order_by('last_updated').\
 annotate(replies=Count('posts') - 1)
 return queryset
 }}}



 **topics.html**
 {{{
 ...
 {% for page_num in paginator.get_elided_page_range %}
 {{ page_num }}
 {% 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/052.b9d377cf85302ccddd045333c24bb567%40djangoproject.com.


Re: [Django] #26142: Provide a way for model formsets to disallow new object creation

2021-09-25 Thread Django
#26142: Provide a way for model formsets to disallow new object creation
-+
 Reporter:  Tim Graham   |Owner:  Vlad
 Type:  New feature  |   Status:  assigned
Component:  Forms|  Version:  dev
 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 Vlad):

 * needs_better_patch:  1 => 0


Comment:

 Added `edit_only` argument to the `formset_factory`.

-- 
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/067.8be5fac4b878eeca119dccb7bf97ac58%40djangoproject.com.


Re: [Django] #33143: Block import-time queries

2021-09-25 Thread Django
#33143: Block import-time queries
-+-
 Reporter:  Adam Johnson |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Adam Johnson):

 Thanks for the developers discussion link Tim. I like the proposal of
 warning and then if there are no serious reports, deprecating from the
 next version. A `RuntimeWarning` sounds appropriate.

 And I see you have some history with this Simon.

 Aymeric was previously "+0" but he may have changed his mind. I will post
 again on the thread with the link to this ticket just to see if there are
 any dissenting opinions.

-- 
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.16a70c7c9554e0bb521a8b6b0bcab86e%40djangoproject.com.


Re: [Django] #33143: Block import-time queries

2021-09-25 Thread Django
#33143: Block import-time queries
-+-
 Reporter:  Adam Johnson |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 I'd be in favor of blocking until *after* `AppConfig.ready()` phase as any
 queries performed at `.ready()` time has the potential to crash due to
 still unapplied migrations (missing table, schema mismatch) and can get
 users in a pickle where they can't even run `migrate`.
 
[https://docs.djangoproject.com/en/3.2/ref/applications/#django.apps.AppConfig.ready
 This is something we've been warning against for a while] and that I've
 had to point to a fair amount of time when reviewing Django project
 changes.

-- 
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.9d35a323d3b1056fd265ccf29eb28ec4%40djangoproject.com.


Re: [Django] #33114: StringAgg() should set output_field to TextField.

2021-09-25 Thread Django
#33114: StringAgg() should set output_field to TextField.
-+-
 Reporter:  Swen Kooij   |Owner:  ali
 Type:   |  sayyah
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.postgres |  Version:  3.2
 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 Simon Charette):

 * 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/067.6f57c52859c2c02dc81cf33945b99ebd%40djangoproject.com.


Re: [Django] #33114: StringAgg() should set output_field to TextField.

2021-09-25 Thread Django
#33114: StringAgg() should set output_field to TextField.
-+-
 Reporter:  Swen Kooij   |Owner:  ali
 Type:   |  sayyah
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.postgres |  Version:  3.2
 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
-+-

Comment (by ali sayyah):

 PR with the fix and a unittest:
 [https://github.com/django/django/pull/14898]

-- 
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/067.051431749e5a8b46de667a210a80770e%40djangoproject.com.


Re: [Django] #33114: StringAgg() should set output_field to TextField.

2021-09-25 Thread Django
#33114: StringAgg() should set output_field to TextField.
-+-
 Reporter:  Swen Kooij   |Owner:  ali
 Type:   |  sayyah
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.postgres |  Version:  3.2
 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 ali sayyah):

 * 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/067.7d833160270c88c8d819b220c89f89bc%40djangoproject.com.


Re: [Django] #33143: Block import-time queries

2021-09-25 Thread Django
#33143: Block import-time queries
-+-
 Reporter:  Adam Johnson |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  dev
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 [https://groups.google.com/g/django-developers/c/7JwWatLfP44/ django-
 developers discussion]

-- 
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.55c668aa1a0babf2cd9539b4fe47b587%40djangoproject.com.


Re: [Django] #6106: make-messages.py should not touch POT-Creation-Date

2021-09-25 Thread Django
#6106: make-messages.py should not touch POT-Creation-Date
-+-
 Reporter:  Marc Fargas  |Owner:  Daniyal
 Type:   |  Abbasi
  Cleanup/optimization   |   Status:  assigned
Component:   |  Version:  dev
  Internationalization   |
 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 Daniyal Abbasi):

 * needs_tests:  1 => 0


Comment:

 Sure. For now I've added a test in the test_extraction.BasicExtractorTests
 class 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.84cb672aa7faac004fef577bfda83dd5%40djangoproject.com.


Re: [Django] #33114: StringAgg() should set output_field to TextField.

2021-09-25 Thread Django
#33114: StringAgg() should set output_field to TextField.
-+-
 Reporter:  Swen Kooij   |Owner:  ali
 Type:   |  sayyah
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.postgres |  Version:  3.2
 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 ali sayyah):

 Replying to [comment:8 Claude Paroz]:
 > main branch (which will target 4.1, now that 4.0 is feature frozen).
 Thank 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.99a72e8baeb3521c8588b8db5098fb01%40djangoproject.com.


Re: [Django] #33114: StringAgg() should set output_field to TextField.

2021-09-25 Thread Django
#33114: StringAgg() should set output_field to TextField.
-+-
 Reporter:  Swen Kooij   |Owner:  ali
 Type:   |  sayyah
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.postgres |  Version:  3.2
 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 Claude Paroz):

 main branch (which will target 4.1, now that 4.0 is feature frozen).

-- 
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/067.48ce83eb526b60e24dd15ca774023523%40djangoproject.com.


Re: [Django] #33114: StringAgg() should set output_field to TextField.

2021-09-25 Thread Django
#33114: StringAgg() should set output_field to TextField.
-+-
 Reporter:  Swen Kooij   |Owner:  ali
 Type:   |  sayyah
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.postgres |  Version:  3.2
 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 ali sayyah):

 Should I make the patch for 3.2 or the main branch?

-- 
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/067.0c571ea9cb5c9423edf1894b62bcc2f1%40djangoproject.com.


[Django] #33143: Block import-time queries

2021-09-25 Thread Django
#33143: Block import-time queries
-+-
   Reporter:  Adam   |  Owner:  nobody
  Johnson|
   Type: | Status:  new
  Cleanup/optimization   |
  Component:  Database   |Version:  dev
  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  |
-+-
 It's possible to make ORM queries at import time. For example:

 {{{
 class Form(forms.Form):
 country = forms.ChoiceField(choices=[c.name for c in
 Country.objects.all()])
 }}}

 I see import time queries fairly frequently, and every time I have
 encountered them they were a mistake. They end up querying the database
 once when the web server starts and caching the data forever, which is
 never desired.

 Python allows imports to happen at any time, so there's no way to detect
 when "import time" is over, and the app is really running. An inner import
 may cause a module to be first loaded during a web request.

 I therefore propose we block queries until *after* the `AppConfig.ready()`
 phase. This would protect against most problems.

 We could block until *before* `AppConfig.ready()`. Queries inside a
 `ready()` method kind-of imply the user knows that the query is one-off at
 startup. But we do encourage users to perform some imports within
 `ready()` methods such as for signal registration.

-- 
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/053.2b82b45f514f1627ee1bf7309e628cdc%40djangoproject.com.


Re: [Django] #33125: Changing model field to become PK creates redundant UNIQUE constraint

2021-09-25 Thread Django
#33125: Changing model field to become PK creates redundant UNIQUE constraint
-+-
 Reporter:  Fabio Sangiovanni|Owner:  Jordan
 Type:   |  Bae
  Cleanup/optimization   |   Status:  assigned
Component:  Migrations   |  Version:  dev
 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 Jordan Bae):

 * 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/065.7fa62691935161b4bf20f0d985d7d5c7%40djangoproject.com.


Re: [Django] #25916: Add lastmod support to sitemapindex

2021-09-25 Thread Django
#25916: Add lastmod support to sitemapindex
--+---
 Reporter:  Matthew Downey|Owner:  David Smith
 Type:  New feature   |   Status:  assigned
Component:  contrib.sitemaps  |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:  sitemap lastmod   | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+---
Changes (by David Smith):

 * needs_better_patch:  1 => 0
 * needs_docs:  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.1ba65e7b2dbd89fd11ef2998e8af1bec%40djangoproject.com.


Re: [Django] #33114: StringAgg() should set output_field to TextField.

2021-09-25 Thread Django
#33114: StringAgg() should set output_field to TextField.
-+-
 Reporter:  Swen Kooij   |Owner:  ali
 Type:   |  sayyah
  Cleanup/optimization   |   Status:  assigned
Component:  contrib.postgres |  Version:  3.2
 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 ali sayyah):

 * owner:  nobody => ali sayyah
 * 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.731f8c8cf5a607f2d3ab1045e12d26fa%40djangoproject.com.