I'm writing filter query against the model which is already created. When I read the document most of the time I see like
def getUserType (self) :
userTypeList = UserType.objects.using (settings.DATABASE_CONF).filter (status=1).values ('user_type_id' , 'user_type_name')
return userTypeList
(this is my actual code).
The question is., this method always expects to pass "self" as parameter. Why do we need it?
Is it reference of the current model and which can be used to send other parameters? Like if I want to pass "user_type_name" as a parameter should I have to pass it as an another parameter or can I attach it within "self" object?