From ca33d307dee3cf68cc9cd2ccfae00c7ff23ea890 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 15 Sep 2007 21:57:25 +0000 Subject: queryset-refactor: Merged to [6300] git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6340 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/validators.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'django/core/validators.py') diff --git a/django/core/validators.py b/django/core/validators.py index 7611aef921..874edaefdd 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -405,12 +405,17 @@ class NumberIsInRange(object): class IsAPowerOf(object): """ - >>> v = IsAPowerOf(2) - >>> v(4, None) - >>> v(8, None) - >>> v(16, None) - >>> v(17, None) - django.core.validators.ValidationError: ['This value must be a power of 2.'] + Usage: If you create an instance of the IsPowerOf validator: + v = IsAPowerOf(2) + + The following calls will succeed: + v(4, None) + v(8, None) + v(16, None) + + But this call: + v(17, None) + will raise "django.core.validators.ValidationError: ['This value must be a power of 2.']" """ def __init__(self, power_of): self.power_of = power_of -- cgit v1.3