title: Django Many to Many Fields - OK with large datasets?
body: <p>I've done a number of searches on here and read through the ManyToMany documentation for Django and think this model type fits my needs. However, given the way this field appears on the admin page, I'm worried I'll have too much data for this type to work correctly for my purpose. </p>
  
  <p>I have two models, Image and Post. I want to set up my models such that an Image can be associated with a number of Posts and the other way around. My concern is that with tens/hundreds of thousands of Posts and Images, the admin page will be unmanageable and take too long to load.</p>
  
  <p>Here's what I have now:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class Image(models.Model):
      post = models.ManyToManyField(Post)
      image = models.ImageField(upload_to=f, blank=True)
  
  class Post(models.Model):
      post_title = models.CharField(max_length=113)
      text = models.CharField(max_length=1500)
      pub_date = models.DateTimeField('post date')
      image = models.ManyToManyField(Image)</code></pre>
  </div>
  </div>
  </p>
  
  <p>Is there a better way to handle this? I thought about creating a separate database table with foreign keys to both Image and Post. Every association between a Post and an Image would have an entry in that table. Would that work?</p>