title: django 'too many SQL variables' error with ModelMultipleChoiceField
body: <p>I have a form with <code>ModelMultipleChoiceField</code> on it, and I am getting <code>'DatabaseError: too many SQL variables'</code> (using SQLite) when the user picks more than 1000 entries in the selection widget and posts the form.</p>
  
  <p>The problem seems to be the method <code>clean</code> of <code>ModelMultipleChoiceField</code>, which tries to select objects from the database simply by the <code>IN</code> SQL clause (e.g. SELECT * FROM projects WHERE id IN (1,2,3)). When the number of numbers in the IN argument rises over 1000 the <code>too many SQL variables</code> happens.</p>
  
  <p>I am using the most recent version of Django (1.5.dev17922), though I think it is irrelevant because similar issues happened even with older versions.</p>
  
  <p>I have always worked around this problem by custom temporary models that I used for joins of more complex queries. But more and more it seems to me that, either there already is a systematic solution to this problem that I am missing (which I hope somebody could point out to me), or there at least needs to be a need for it -- how do you address similar situations? -- in which case I can start thinking how to propose something general that could later be incorporated into Django.</p>
  
  <p>Thanks for any suggestions or help.</p>
  
  <p>EDIT: I posted the same question to django-users ML, and quite a fruitful discussion got going; <a href="https://groups.google.com/forum/?fromgroups#!topic/django-users/aI7uO49UVRU" rel="nofollow">https://groups.google.com/forum/?fromgroups#!topic/django-users/aI7uO49UVRU</a></p>