Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#185 closed defect (invalid)

Chaining views

Reported by: maurycy Owned by: adrian
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: UI/UX:

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 Changed 10 years ago by deelan

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

comment:2 Changed 10 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:3 Changed 10 years ago by maurycy

  • Resolution invalid deleted
  • Status changed from closed to reopened

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 Changed 10 years ago by adrian

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 Changed 10 years ago by rjwittams

  • Resolution set to invalid
  • Status changed from reopened to closed

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