Django

Code

Changeset 4772

Show
Ignore:
Timestamp:
03/21/07 22:00:12 (1 year ago)
Author:
mtredinnick
Message:

Fixed #2351 -- Fixed problem with using ".count" attribute of QuerySets? in
templates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/query.py

    r4754 r4772  
    110110    def __getitem__(self, k): 
    111111        "Retrieve an item or slice from the set of results." 
     112        if not isinstance(k, (slice, int)): 
     113            raise TypeError 
    112114        assert (not isinstance(k, slice) and (k >= 0)) \ 
    113115            or (isinstance(k, slice) and (k.start is None or k.start >= 0) and (k.stop is None or k.stop >= 0)), \