From b6ec268e23c5b8e90ed3c3db3e220deca6eee8cc Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Sun, 14 Nov 2010 23:21:39 +0000 Subject: Fiexed #3055 -- Validate that models target of a GenericRelation have a GenericForeignKey field. Thanks jason for diagnosing the problem and Marcos Moyano for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14563 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/itercompat.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'django/utils') diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py index ab27c3ee01..d4ff2503c7 100644 --- a/django/utils/itercompat.py +++ b/django/utils/itercompat.py @@ -37,3 +37,9 @@ def all(iterable): if not item: return False return True + +def any(iterable): + for item in iterable: + if item: + return True + return False -- cgit v1.3