Project

General

Profile

Feature #25

Add node to request object

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

Status:
Resolved
Priority:
Low
Category:
Core
Target version:
-
Start date:
10/06/2010
Due date:
% Done:

0%

Estimated time:

Description

It might be useful to have middleware that provides the current node (if any) as request.node. Occasionally, for example, someone may want to write a view that overrides a certain address but which still references the node at that path.

History

#1

Updated by Stephen Burrows over 13 years ago

  • Status changed from New to Feedback

Thoughts?

#2

Updated by Joseph Spiros over 13 years ago

Although I'm not immediately aware of a case where I would use this, it seems like something that may be useful to others, or in the future. So, sure. Not even sure if a middleware makes sense, since the request needs to be processed for a node to be found. But then, we could put the node finding into the middleware, make the middleware required, and then use the request.node object in the router view.

#3

Updated by Stephen Burrows over 13 years ago

We could also write the router view to use request.node if available and otherwise use the node-finder.

#4

Updated by Stephen Burrows over 13 years ago

  • Status changed from Feedback to In Progress
  • Assignee set to Stephen Burrows

This is currently implemented in my node_middleware branch. The commit is currently 01a66d144c3ac6539991c5b9f00e1bd5bab132ee, but I may rebase the work onto ithinksw/master if that is desired.

#5

Updated by Stephen Burrows over 13 years ago

  • Status changed from In Progress to Resolved

Merged into ithinksw/master with commit 9592f8df376c7dacacd49bb7587ee494ad339035

Also available in: Atom PDF