from django_cte import CTEManager
class Order(Model):
objects = CTEManager()
with this:
from django_cte import CTEModelMixIn
class Order(Model, CTEModelMixIn):
entirely, optionally (that is the earlier syntax works too). This is simply a more canonical (IMHO) Django way of offering the same service (and has extensibility advantages - as in should the package ever need any more model enhancements, the MixIn is there to take them)
If there was only one way to do it, I'd still vote for a MixIn rather than overriding an attribute, as it strikes me as both more Django and is more extensible. Either way, it's a small value add.
Replaces this syntax:
with this:
entirely, optionally (that is the earlier syntax works too). This is simply a more canonical (IMHO) Django way of offering the same service (and has extensibility advantages - as in should the package ever need any more model enhancements, the MixIn is there to take them)