- class Manager
A Manager is the interface through which database query operations are provided to Django models. At least one Manager exists for every model in a Django application.
Managers | Django documentation | Djangohttps://docs.djangoproject.com/en/dev/topics/db/managers/
You can override a Manager‘s base QuerySet by overriding theManager.get_query_set() method. get_query_set() should return a QuerySet with the properties you require.
Django 1.6 後 get_query_set() 改成 get_queryset()
沒有留言:
張貼留言