Django

Code

Ticket #7714 (closed: fixed)

Opened 6 months ago

Last modified 5 months ago

corrected documentation for {% url %} resolver

Reported by: V Assigned to: nobody
Milestone: 1.0 Component: Documentation
Version: SVN Keywords: url resolver
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

Description (Last modified by mtredinnick)

there were two errors: 1. ('^client/(\d+)/$', 'app_name.app_views.client') originally ('^client/(\d+)/$', 'app_views.client') gives you an ImportError (ViewDoesNotExist)

2. {% url app_name.app_views.client client.id %} originally {% url app_views.client client.id %} simply doesn't work

to check I did:

  1. startapp app_name
  2. add urls.py to the main urls.py as in the docs
  3. add urls.py to app_name/urls.py as shown above
  4. creates app_views.py with view client that gives back {% url app_views.client client.id %}

Attachments

patch.txt (0.9 kB) - added by Viktor <viktor.nagy@gmail.com> on 07/11/08 03:51:49.
7714.url_tag_doc.diff (0.8 kB) - added by julien on 07/18/08 18:50:43.
Revised Viktor's patch, adding 'project_name' to the paths

Change History

07/11/08 03:51:49 changed by Viktor <viktor.nagy@gmail.com>

  • attachment patch.txt added.

07/11/08 04:06:33 changed by mtredinnick

  • needs_better_patch changed.
  • description changed.
  • needs_tests changed.
  • needs_docs changed.

Unbroke description.

07/11/08 17:06:14 changed by garcia_marc

  • needs_better_patch set to 1.
  • stage changed from Unreviewed to Accepted.
  • milestone set to 1.0.

I agree on that, but I think that to correct it isn't enough to add the application name, it's also needed to add the project name.

So app_views.client should be project_name.app_name.app_views.client

07/18/08 18:50:43 changed by julien

  • attachment 7714.url_tag_doc.diff added.

Revised Viktor's patch, adding 'project_name' to the paths

07/18/08 21:49:37 changed by julien

  • stage changed from Accepted to Ready for checkin.

08/12/08 18:22:27 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

(In [8332]) Clarified a bit of the {% url %} documentation. Fixes #7714.


Add/Change #7714 (corrected documentation for {% url %} resolver)




Change Properties
Action