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
Post a Comment