[Answered ]-Pass several values in a manager

2👍

I think the code you have given is needlessly complicated. You don’t need to define a queryset subclass, as the filtering can and should be done in the manager:

class VehicleManager(models.Manager):
    def vehicle_query(self, year):
      return self.get_query_set().filter(common_vehicle__year__year__exact=year).exclude(status__status='Incoming')

However, I don’t really understand your question. You already know how to pass one variable into a manager method, why is passing additional ones any more difficult?

Leave a comment