[Fixed]-How to create a custom related manager in Django?

1👍

This isn’t really the job of a manager, but just a normal model method. Since you’re looking for items that are related to a specific instance of ModelA, you can make a method on that model. If you really want, you can call it modelc_set and make it a property:

@property
def modelc_set(self):
    return ModelC.objects.filter(modelb__modela=self).distinct()

Leave a comment