dynamicweb2/hosting/managers.py

10 lines
303 B
Python
Raw Normal View History

2023-12-06 11:13:47 +00:00
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()