title: Python/Django circular dependency with models.py (NOT in ForeignKey.etc)
body: <p>I have x <code>models.py</code> files, in x different Django apps. I have certain queries related to said models thatI call throughout my app. I figured the best way to DRY-ify this is to have the query be called by a method inside the model.</p>
  
  <p>These query methods actually query /other/ models inside /other/ apps (and therefore other <code>models.py</code> files). I understand that this increases coupling, but it's a large and highly specialised project, so I can't really write generic reusable apps for a lot of the stuff.</p>
  
  <p>For example:</p>
  
  <pre><code>class Mentor(models.Model):
      # ...
      def get_future_shifts(self):
          return Shift.objects.filter(mentor = self, session__date__gt = timezone.now())
  </code></pre>
  
  <p>I've ended up with a circular dependency (it spans along 4 apps so I figured it was too long to post ALL that code here unless absolutely necessary). </p>
  
  <p>The usual circular dependency advice for Django models on SO is related to <code>models.ForeignKey</code> and that is not my issue. I need to actually <em>access</em> the 'foreign' model.</p>
  
  <p>I'm told that a circular dependency is a sign of bad design, and my bad design is that I have too many dynamic helper methods in my models? Django doesn't really provide anywhere else to put these without adhering to DRY.</p>