Opened 19 years ago

Closed 18 years ago

Last modified 17 years ago

#185 closed defect (invalid)

Chaining views

Reported by: maurycy Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, it's possible to assign only one view to specified URL pattern. It would be great to allow to create more complicated chains of views.

There are two questions. First, how to extend urlpatterns to support more than one view. Second, how to pass HttpResponse between without breaking existing modules.

Change History (5)

comment:1 by deelan, 19 years ago

I'm curious to known some use-cases for this request.

comment:2 by Adrian Holovaty, 19 years ago

Resolution: invalid
Status: newclosed

Solve this at the view level, not at the URLconf level.

comment:3 by maurycy, 19 years ago

Resolution: invalid
Status: closedreopened

I'm not sure if solving this problem on view layer is good idea.

Let's say I create shop. On *almost* every page on left I have last top sell products, on right I have recommended products and list of categories. Every action can be easily done with generic views.

Currently with this kind of challange I have to, as adrain suggested, create a lot of views playing with generic views or use tags. Both solutions are time wasteful. Of course, I can create inhereting views, but this approach hides logic and makes code harder to read.

With views chaining it would be lot simpler and, what's important, very elegant with DRY principle in practice.

comment:4 by Adrian Holovaty, 19 years ago

maurycy: Please provide a more detailed example, and we'll be happy to show you how to accomplish this without rearchitecting the URLconf system.

comment:5 by rjwittams, 18 years ago

Resolution: invalid
Status: reopenedclosed

This is old and ill-defined. Reopen with a better explanation including an example.

Note: See TracTickets for help on using tickets.
Back to Top