mirror of
https://github.com/django/django.git
synced 2025-12-15 21:45:20 +00:00
Fixed #26013 -- Moved django.core.urlresolvers to django.urls.
Thanks to Tim Graham for the review.
This commit is contained in:
parent
df3d5b1d73
commit
16411b8400
117 changed files with 961 additions and 922 deletions
|
|
@ -98,7 +98,7 @@ First we need to add :meth:`~django.db.models.Model.get_absolute_url()` to our
|
|||
.. snippet::
|
||||
:filename: models.py
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.urls import reverse
|
||||
from django.db import models
|
||||
|
||||
class Author(models.Model):
|
||||
|
|
@ -115,7 +115,7 @@ here; we don't have to write any logic ourselves:
|
|||
:filename: views.py
|
||||
|
||||
from django.views.generic.edit import CreateView, UpdateView, DeleteView
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.urls import reverse_lazy
|
||||
from myapp.models import Author
|
||||
|
||||
class AuthorCreate(CreateView):
|
||||
|
|
@ -131,8 +131,8 @@ here; we don't have to write any logic ourselves:
|
|||
success_url = reverse_lazy('author-list')
|
||||
|
||||
.. note::
|
||||
We have to use :func:`~django.core.urlresolvers.reverse_lazy` here, not
|
||||
just ``reverse`` as the urls are not loaded when the file is imported.
|
||||
We have to use :func:`~django.urls.reverse_lazy` here, not just
|
||||
``reverse()`` as the urls are not loaded when the file is imported.
|
||||
|
||||
The ``fields`` attribute works the same way as the ``fields`` attribute on the
|
||||
inner ``Meta`` class on :class:`~django.forms.ModelForm`. Unless you define the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue