¡@

Home 

python Programming Glossary: make_sound

Right way to return proxy model instance from a base model instance in Django?

http://stackoverflow.com/questions/2218867/right-way-to-return-proxy-model-instance-from-a-base-model-instance-in-django

type models.CharField max_length 255 class Dog Animal def make_sound self print Woof class Meta proxy True class Cat Animal def make_sound.. self print Woof class Meta proxy True class Cat Animal def make_sound self print Meow class Meta proxy True Let's say I want to do.. do animals Animal.objects.all for animal in animals animal.make_sound I want to get back a series of Woofs and Meows. Clearly I could..

As a Java programmer learning Python, what should I look out for? [closed]

http://stackoverflow.com/questions/2339371/as-a-java-programmer-learning-python-what-should-i-look-out-for

Dog and Cat to inherit from just so you can have a generic make_sound method. Just do this class Dog object def make_sound self return.. make_sound method. Just do this class Dog object def make_sound self return woof class Cat object def make_sound self return.. def make_sound self return woof class Cat object def make_sound self return meow class LolCat object def make_sound self return..