Project

General

Profile

Feature #79

Abstract "Target URL" model class

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

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

0%

Estimated time:

Description

Currently, Shipherd has a fairly sophisticated URL targeting system, which can redirect people to a url (absolute or relative) or a node (or its view's subpaths, even allowing reversing). It might make sense to have this kind of functionality i.e. for the Redirect View. If it's something that will be shared like this, it would make sense to have an abstract parent class that defines shared fields etc.


Related issues

Related to Philo - Feature #76: Add support for ordinary reversed urlsResolved01/22/2011

Actions
Related to Philo - Feature #78: Add support for instances as reversing arguments to ShipherdNew01/28/2011

Actions

Associated revisions

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

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.

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 over 13 years ago

If this is done, remember to change the docs.

#2

Updated by Stephen Burrows about 13 years ago

Resolved with commit 6ac457d4ac226a474e988dfb898682ae04a86eb0

#3

Updated by Stephen Burrows about 13 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF