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
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
2 matches
Mail list logo