I understand that if I want to establish a foreign key relationship for this model:
class MyModel(models.Model):
pass
... from this location
/myproject
/myapp
models.py (MyModel)
... I can use a "string-named" relationship to avoid import-time errors.
# this is in a different app within myproject
class DependentModel(models.Model):
my_model = models.ForeignKey('mayapp.MyModel')
But how do I establish that same ForeignKey relationship with a string when my models have been distributed across a models dir (e.g. not contained within one models.py file)
/myproject
/myapp
/models
/one.py (MyModel)
/two.py (other models)
(Assume that I can't just import the model directly, ala from myapp.models.one import MyModel
)