So here's a question for a Django wizard. I am inheriting an object Manager something along the lines as follows:
class MyObjManager(models.Manager):
def total_values(self, myobj_id):
return 49
def what_the_heck(self, poll_id):
return 48
class TestMe():
def what_the_heck(self, poll_id):
return 47
Now if I create a model that uses this object manager as follows it doesn't seem to work.
class MyObj(models.Model):
x = models.CharField(max_length=200)
y = models.DateTimeField('date published')
objects = MyObjManager()
kb = MyObjManager()
testMe = TestMe()
def total_values(self):
#A return self.objects.total_values(1)
#B return self.objects.yyy(1)
#C return self.kb.what_the_heck(1)
#D return 50
#E return self.testMe.what_the_heck(1)
#F return self.objects.what_the_heck(1)
Now suppose that A,B,C,D,E are commented out one at a time respectively. Here's the results if I call myObj.total_values. ( where myObj is instance of MyObj) A) Nothing B) Nothing C) Nothing D) 50 E) 47 F) Nothing
I've used two object managers in this example, but the same thing happens if I only use one. Any insights into why I can't seem to access the methods in my overriden object manager?