Project

General

Profile

Feature #75

APPEND_SLASH support

Added by Stephen Burrows over 13 years ago. Updated about 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/22/2011
Due date:
% Done:

0%

Estimated time:

Description

Django already provides an APPEND_SLASH setting; however, this takes effect only in cases where a matching url is not found. It might make sense for the node view or the node middleware to use this setting to handle automatic slash appending in cases where either no Node is found or the subpath doesn't match.

Additionally, node.get_absolute_url currently appends a slash to its path. Perhaps this shouldn't be the case - it might make sense to add an append_slash kwarg to the method so that programmers can decide which they want.

And finally, subpaths defined i.e. by blogviews and newsletterviews are currently inconsistent in their choice of trailing slashes, optional trailing slashes, or no trailing slashes. This is at least partly my fault. :-p Consistency might be useful. DDN.

Associated revisions

Revision dbb5ab77 (diff)
Added by Stephen Burrows about 13 years ago

Refactored Node.get_absolute_url and related functions (such as MultiView.reverse) to use a new Node.construct_url function, which handles constructing any type of url involving a node or raises an appropriate error if this is not possible. Moved MultiView.reverse to View and merged View.get_subpath into it. Added APPEND_SLASH support to node_view, including support for resolving non-philo targets (resolves issue 75). Made urlpatterns for penfield and waldo MultiViews unambiguous. Altered LazyNode to always return a subpath of at least "/". Added handles_subpath methods to View and MultiView.

Revision 06dc22d5 (diff)
Added by Stephen Burrows about 13 years ago

Removed trailing_pathsep support from TreeManager.get_with_path. Set nodes to have URLs without a trailing slash, and set node_view to redirect node urls with a trailing slash to the same url, but without the slash. Resolves issue 75 completely.

Revision 92aff114
Added by Joseph Spiros about 13 years ago

Merge branch 'master' of git://github.com/melinath/philo

  • 'master' of git://github.com/melinath/philo:
    Added indices to all Attribute fields to improve lookup speed. Added related_lookup_fields to NodeAdmin for grappelli forward-compatibility.
    Tweaked LazyNode to handle trailing slashes. Corrected missing import in models/nodes.py.
    Corrected shipherd handling of the navigation_items related_name following commit 6ac457d4ac226a474e988dfb898682ae04a86eb0.
    Removed trailing_pathsep support from TreeManager.get_with_path. Set nodes to have URLs without a trailing slash, and set node_view to redirect node urls with a trailing slash to the same url, but without the slash. Resolves issue 75 completely.
    Added an abstract TargetURLModel to handle issues related to targeting a node, a node's subpaths, a url, or a reversable view. Addresses issue 79 and issue 76.
    Minor correction to LazyNode's use of subpath to avoid NameErrors.
    Minor cleanup to penfield.utils after get_absolute_url refactor.
    Refactored Node.get_absolute_url and related functions (such as MultiView.reverse) to use a new Node.construct_url function, which handles constructing any type of url involving a node or raises an appropriate error if this is not possible. Moved MultiView.reverse to View and merged View.get_subpath into it. Added APPEND_SLASH support to node_view, including support for resolving non-philo targets (resolves issue 75). Made urlpatterns for penfield and waldo MultiViews unambiguous. Altered LazyNode to always return a subpath of at least "/". Added handles_subpath methods to View and MultiView.
    Registered Tag as a value model.
    Corrected EntityAdminMetaclass handling of inherited vs. declared readonly_fields.
    Clarified error messages and docstrings in models/nodes.py. Removed an extraneous argument to MultiView.urlpatterns.
    Added navigation key to shipherd's has_navigation filter.

Revision dbccf6bf
Added by Joseph Spiros about 13 years ago

Merge branch 'master' into gilbert

  • master: (135 commits)
    Added db_index to Contentlet/ContentReference names, AttributeValue fields, and Navigation keys. Added related_lookup_fields to shipherd admins and corrected its use on NodeAdmin/RedirectAdmin. Corrected TargetURLModel.get_target_url call of get_reverse_params. Corrected typo in BlogView feed creation.
    Minor fixes and additions to better_feeds following testing.
    Added indices to all Attribute fields to improve lookup speed. Added related_lookup_fields to NodeAdmin for grappelli forward-compatibility.
    Moved FeedMultiViewMixin to models.py and renamed to FeedView. Improved feed type support and clarified the API (based heavily on django.contrib.syndication.views.Feed). Adjusted NewsletterView and BlogView to use the new API.
    Tweaked LazyNode to handle trailing slashes. Corrected missing import in models/nodes.py.
    Corrected shipherd handling of the navigation_items related_name following commit 6ac457d4ac226a474e988dfb898682ae04a86eb0.
    Removed trailing_pathsep support from TreeManager.get_with_path. Set nodes to have URLs without a trailing slash, and set node_view to redirect node urls with a trailing slash to the same url, but without the slash. Resolves issue 75 completely.
    Added an abstract TargetURLModel to handle issues related to targeting a node, a node's subpaths, a url, or a reversable view. Addresses issue 79 and issue 76.
    Minor correction to LazyNode's use of subpath to avoid NameErrors.
    Minor cleanup to penfield.utils after get_absolute_url refactor.
    Refactored Node.get_absolute_url and related functions (such as MultiView.reverse) to use a new Node.construct_url function, which handles constructing any type of url involving a node or raises an appropriate error if this is not possible. Moved MultiView.reverse to View and merged View.get_subpath into it. Added APPEND_SLASH support to node_view, including support for resolving non-philo targets (resolves issue 75). Made urlpatterns for penfield and waldo MultiViews unambiguous. Altered LazyNode to always return a subpath of at least "/". Added handles_subpath methods to View and MultiView.
    Registered Tag as a value model.
    Corrected EntityAdminMetaclass handling of inherited vs. declared readonly_fields.
    Clarified error messages and docstrings in models/nodes.py. Removed an extraneous argument to MultiView.urlpatterns.
    Added navigation key to shipherd's has_navigation filter.
    Merged cowell back into core.
    Added support for DateTime information being stored in a JSONAttribute. Switched ForeignKeyAttribute and M2MAttribute to store the related model in self.to instead of overwriting self.model.
    Initial raw_id_fields support for proxy fields. Involves hacks to bypass model validation for things like raw_id_fields, where validation depends on model._meta.get_field(). Renamed EntityForm to ProxyFieldForm to more accurately reflect its purpose. Removed extraneous code from ProxyFieldForm that didn't belong there.
    Ungenericized get_item_queryset and added tag/issue queryset fetching methods to BlogView and NewsletterView, respectively. Re-added the tag_archive_view and issue_archive_view methods and set them up to use these methods.
    Added get_item_queryset method to BlogView and NewsletterView so that subclasses can replace this functionality. Moved get_context hook onto the MultiView base class and added a basic_view method which provides a simple way to add a view method to a multiview's urlpatterns for a related View subclass instance.
    ...

Conflicts:
README

History

#1

Updated by Stephen Burrows about 13 years ago

  • Status changed from Feedback to Resolved

Resolved with commit dbb5ab771be406d90ac522e0ecd644e5ddb21e6f.

#2

Updated by Stephen Burrows about 13 years ago

More fully resolved with commit 06dc22d5cbde2329fe2e5926243697e492b0a9ef.

Also available in: Atom PDF