# models.py
class MyModel(models.Model):
prop1 = ...
prop2 = ...
def f1(self):
pass
def f2(self):
pass
However, I wanted to have this structure:
# models.py
class MyModel(models.Model):
prop1 = ...
prop2 = ...
# proxies.py
from myapp import models
class MyModel(models.MyModel):
def f1(self):
pass
def f2(self):
pass
class Meta:
proxy = True
But, when I tried to make some tests:
$ python manage.py shell
Python 2.7.3 (default, Apr 20 2012, 22:44:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from myapp.proxies import MyModel
>>> MyModel
<class 'MyProject.myapp.models.MyModel'>
So, when I ask for the proxy it gives me the model in models.py. And, of course, it keeps the properties defined on the model but lacks all of the methods in the proxy. Could anybody please tell me WTF is going on here?
Thanks for your help :)