django - Override default queryset with using as_manager -


django documents state can override default queryset using manager's get_queryset method.

what if user models.queryset , as.manager method avoid duplicate methods. how can override default query?

it seems get_queryset method of models.queryset doesnt seems work in case.

thanks.

you can create manage class inheriting models.manager , can define own query set method.

in model.py, should assign class property given below:

example = examplemanager()

now can use example instead of objects , can call respective examplemanager method.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -