Re: Best practice to render the view based on the user

2015-01-30 Thread Collin Anderson
Hi, Not sure about whether it's a good idea or not. If statements might also be good enough. Be careful with security, but in theory something like this should work: method_name = 'person' + person.type method = getattr(self, method_name) output = method() Collin On Wednesday, January 28, 201

Best practice to render the view based on the user

2015-01-27 Thread Karim
Hi! I would like to render views based on the user. I have some differents type of users on my app and I would like to create a class like this one for the view: class MyView(MyCustomView) # MyCustomView subclass View def __init__(self, *args, **kwargs): # common code for all persons