--
Ticket URL: <https://code.djangoproject.com/ticket/16406>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* has_patch: 0 => 1
* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Design decision needed
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:1>
* stage: Design decision needed => Accepted
Comment:
Good idea!
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:2>
* owner: nobody => antoviaque
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:3>
Comment (by apollo13):
New and cleaner patch, but it does change behavior (see changes of the doc
file)
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:4>
* owner: antoviaque => nobody
Comment:
Looks like you beat me to the update apollo : )
I've added a test specific to the behavior change though, you may want to
integrate it in your patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:5>
Comment (by anonymous):
If your patch includes my changes that should be fine…
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:6>
* needs_better_patch: 0 => 1
Comment:
Patch no longer applies cleanly.
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:8>
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:9>
* owner: nobody => ppalex
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:10>
Comment (by Alexandre Prieto Pantoja):
Hello,
I'am trying to figure out the context of this ticket but I am rather stuck
on the resolution until now.
I reproduced the use case with the information in the ticket. My code is
now the is the following:
== views.py file:
{{{
#!python
def homepage(request, *args, **kwargs):l
links = []
langs = settings.LANGUAGES
match = resolve(request.path)
for lang in langs:
with translation.override(lang[0]):
links.append(reverse(match.url_name, args=match.args,
kwargs=match.kwargs))
message = _('Welcome to our site!')
return render(request, 'ticket_16406/homepage.html', {'message':
message, 'links':links})
}}}
== url.py file:
{{{
#!python
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.urls import path, re_path
from django.utils.translation import gettext_lazy as _
from ticket_16406 import views
urlpatterns = [
path(_('admin/'), admin.site.urls),
]
urlpatterns += i18n_patterns(
re_path(_(r'^home/(?P<slug>[\w-]+)/$'), views.homepage, {'extra':
True}, name="homepage"),
)
}}}
== template
{{{
{% for link in links %}
<a href={{link}}>{{link}}</a>
{% endfor %}
}}}
I have access to content in different languages in my template.
I don't find the problem I have to tackle here.
Could you give me more information/details on "why the patch no longer
applies cleanly"?
It would be a great help. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:11>
* cc: Alexandre Prieto Pantoja (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:12>
* owner: Alexandre Prieto Pantoja => Anvesh Mishra
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:13>
Comment (by Pedro Schlickmann Mendes):
Replying to [comment:9 David Smith]:
Can you give us more details on why the patch no longer applies cleanly?
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:14>
* owner: Anvesh Mishra => Alokik Roy
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:15>
Comment (by Alokik Roy):
PR of my work so far:
https://github.com/django/django/pull/15402
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:16>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:17>
* needs_better_patch: 0 => 1
Comment:
The patch is missing tests (all code changes require tests). "Needs tests"
is checked if there is a patch without tests, not an indication that tests
are required. Also the documentation is incomplete. Please review the
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/submitting-patches/#patch-review-checklist patch review checklist] for
all requirements.
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:18>
* cc: Alokik Roy (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:20>
* needs_better_patch: 1 => 0
Comment:
Added tests and documentation
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:19>
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:21>
* needs_tests: 1 => 0
Comment:
Requested Tests added.
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:22>
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:23>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:24>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"baf9604ed8fed3e6e7ddfaca2d83c377c81399ae" baf9604]:
{{{
#!CommitTicketReference repository=""
revision="baf9604ed8fed3e6e7ddfaca2d83c377c81399ae"
Fixed #16406 -- Added ResolveMatch.captured_kwargs and extra_kwargs.
Thanks Florian Apolloner for the review and implementation idea.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16406#comment:25>