Skip to content

managers#

ProxyBasePolymorphicQuerySet#

Bases: PolymorphicQuerySet

Source code in src/apps/common/managers.py
class ProxyBasePolymorphicQuerySet(PolymorphicQuerySet):
    def create(self, **kwargs):
        """Same as QuerySet.create but model is determined dynamically."""
        obj = self.model.get_proxy_instance(**kwargs)
        self._for_write = True
        obj.save(force_insert=True, using=self.db)
        return obj

create(**kwargs) #

Same as QuerySet.create but model is determined dynamically.

Source code in src/apps/common/managers.py
def create(self, **kwargs):
    """Same as QuerySet.create but model is determined dynamically."""
    obj = self.model.get_proxy_instance(**kwargs)
    self._for_write = True
    obj.save(force_insert=True, using=self.db)
    return obj

ProxyBasePolymorphicManager#

Bases: PolymorphicManager

Manager for models based on ProxyBaseModel.

Source code in src/apps/common/managers.py
class ProxyBasePolymorphicManager(PolymorphicManager):
    """Manager for models based on ProxyBaseModel."""

    queryset_class = ProxyBasePolymorphicQuerySet