Miscellaneous Models

class philo.models.nodes.TargetURLModel(*args, **kwargs)

An abstract parent class for models which deal in targeting a url.

target_node

An optional ForeignKey to a Node. If provided, that node will be used as the basis for the redirect.

url_or_subpath = None

A CharField which may contain an absolute or relative URL, or the name of a node’s subpath.

reversing_parameters = 5

A JSONField instance. If the value of reversing_parameters is not None, the url_or_subpath will be treated as the name of a view to be reversed. The value of reversing_parameters will be passed into the reversal as args if it is a list or as kwargs if it is a dictionary. Otherwise it will be ignored.

target_url

Calculates and returns the target url based on the target_node, url_or_subpath, and reversing_parameters. The results will be memoized by default; this can be prevented by passing in memoize=False.

Project Versions

Previous topic

Collections

Next topic

Custom Fields

This Page