Hello,
You have defined "MyClass" for "foo" application in its models.py, and you want to use that class in your application "bar"?
You'll find how to use models from another app in Django documentation [1]. A widly spread example is the import of User in your app from django.contrib.auth [2]. By searching the web for "from django.contrib.auth import User", I found a discussion about the best way to import [3].
Regards
[1] http://docs.djangoproject.com/en/dev/topics/db/models/#models-across-files
[2] http://docs.djangoproject.com/en/dev/topics/auth/#module-django.contrib.auth
[3] http://stackoverflow.com/questions/1704058/python-and-django-best-import-practices
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment