📜  django 模型管理器用户 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:19.750000             🧑  作者: Mango

代码示例1
class CustomManager(models.Manager):
    def manager_only_method(self):
        return

class CustomQuerySet(models.QuerySet):
    def manager_and_queryset_method(self):
        return

class MyModel(models.Model):
    objects = CustomManager.from_queryset(CustomQuerySet)()