I have this code
class PbsObjectUpdate(UpdateView):
def get_template_names(self):
model_name = self.model.__name__
I can get the model inside any function by using
self.model.__name__
But how can get that outside the function and just below the class i.e
class PbsObjectUpdate(UpdateView):
model_name = model.__name__
because i don’t ahve self in that part
You can make a getter:
Now you can use
PbsObjectUpdate().model_name