dynamicweb2/hosting/managers.py
2023-12-06 16:43:47 +05:30

9 lines
303 B
Python
Executable file

from django.db import models
class VMPlansManager(models.Manager):
def active(self, user, **kwargs):
return self.prefetch_related('hosting_orders__customer__user').\
filter(hosting_orders__customer__user=user, hosting_orders__approved=True, **kwargs)\
.distinct()