Changeset 5512 for django/branches/boulder-oracle-sprint/django/http
- Timestamp:
- 06/22/07 11:56:04 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/boulder-oracle-sprint/django/http/__init__.py
r5491 r5512 223 223 if isinstance(content, unicode): 224 224 content = content.encode(self._charset) 225 226 # If self._container was an iterator, we have just exhausted it, so we227 # need to save the results for anything else that needs access228 if not self._is_string:229 self._container = [content]230 self._is_string = True231 225 return content 232 226 … … 238 232 239 233 def __iter__(self): 240 for chunk in self._container: 241 if isinstance(chunk, unicode): 242 chunk = chunk.encode(self._charset) 243 yield chunk 234 self._iterator = self._container.__iter__() 235 return self 236 237 def next(self): 238 chunk = self._iterator.next() 239 if isinstance(chunk, unicode): 240 chunk = chunk.encode(self._charset) 241 return chunk 244 242 245 243 def close(self):
