Re: Dynamic View Selection

2017-08-13 Thread Khai Weng Au Yeong
Hey, Russ. Alright, that answers plenty. If I were to do this I think I would experiment with implementing this into the Middleware segment. Thanks, Khai On Saturday, 12 August 2017 01:03:18 UTC+8, Russell Keith-Magee wrote: > > Yes - but it doesn’t depend on some hidden feature of Django. It’

Re: Dynamic View Selection

2017-08-11 Thread Russell Keith-Magee
Yes - but it doesn’t depend on some hidden feature of Django. It’s A Django View is just a function that accepts a request + args, and returns a response. That view can, itself, call other functions - including other functions that can act as views. So, you could write a “switch statement” view

Dynamic View Selection

2017-08-11 Thread Khai Weng Au Yeong
Not sure if this has been covered before, but I was thinking about this for awhile. Is there a way to dynamically select a View to be used by a URL without having to replicate the URL dispatcher over and over via a "superceding" like method. Like for example, in my project (let's say it's gener