diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2014-01-20 10:45:21 +0800 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2014-01-20 10:45:21 +0800 |
| commit | d818e0c9b2b88276cc499974f9eee893170bf0a8 (patch) | |
| tree | 13ef631f7ba50bf81fa36f484abf925ba8172651 /tests/admin_scripts/app_raising_messages | |
| parent | 6e7bd0b63bd01949ac4fd647f2597639bed0c3a2 (diff) | |
Fixed #16905 -- Added extensible checks (nee validation) framework
This is the result of Christopher Medrela's 2013 Summer of Code project.
Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian
Apolloner, and Alex Gaynor for review notes along the way.
Also: Fixes #8579, fixes #3055, fixes #19844.
Diffstat (limited to 'tests/admin_scripts/app_raising_messages')
| -rw-r--r-- | tests/admin_scripts/app_raising_messages/__init__.py | 0 | ||||
| -rw-r--r-- | tests/admin_scripts/app_raising_messages/models.py | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/admin_scripts/app_raising_messages/__init__.py b/tests/admin_scripts/app_raising_messages/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/admin_scripts/app_raising_messages/__init__.py diff --git a/tests/admin_scripts/app_raising_messages/models.py b/tests/admin_scripts/app_raising_messages/models.py new file mode 100644 index 0000000000..aece8a8176 --- /dev/null +++ b/tests/admin_scripts/app_raising_messages/models.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.core import checks +from django.db import models + + +class ModelRaisingMessages(models.Model): + @classmethod + def check(self, **kwargs): + return [ + checks.Warning( + 'First warning', + hint='Hint', + obj='obj' + ), + checks.Warning( + 'Second warning', + hint=None, + obj='a' + ), + checks.Error( + 'An error', + hint='Error hint', + obj=None, + ) + ] |
