Changes between Initial Version and Version 2 of Ticket #14441


Ignore:
Timestamp:
Oct 11, 2010, 11:13:00 AM (14 years ago)
Author:
Alex Gaynor
Comment:

Reformatted the message. Can you try this on trunk, I'm almost positive I saw ian kelly commit a fix for this.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14441

    • Property Triage Stage UnreviewedDesign decision needed
  • Ticket #14441 – Description

    initial v2  
    11Trying to retrieve a set of objects based on field values. I build the set of values as an array
    2 
     2{{{
    33namelist=[]
    4 
     4}}}
    55.. some code that does namelist.append(name) many times
    6 
     6{{{
    77obl=MyObject.objects.filter(namefield__in=namelist)
    88
    99obl.count()
     10}}}
    1011if namelist is longer than 1000 then Oracle throws an error
     12{{{
    1113Traceback (most recent call last):
    1214  File "<console>", line 1, in <module>
     
    2426    raise e
    2527DatabaseError: ORA-01795: maximum number of expressions in a list is 1000
    26 
     28}}}
    2729I don't know if there is an easy way to combine querysets as splitting them into batches of a suitable number would be no problem if they could be combined later.
Back to Top