diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-02-23 22:16:26 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-02-23 22:16:26 +0000 |
| commit | 63d85a684ac713b74a8ea5fee3757139229e45a5 (patch) | |
| tree | 0d0828536fbf2e29695e6c7baf0f316144053f83 /tests/regressiontests/comment_tests/custom_comments/__init__.py | |
| parent | 7d4a954836069d740d24101078cfadb4580533c2 (diff) | |
Fixed #8630: finished the custom comment app API that was left out of 1.0. This means it's now possible to override any of the models, forms, or views used by the comment app; see the new custom comment app docs for details and an example. Thanks to Thejaswi Puthraya for the original patch, and to carljm for docs and tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9890 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/comment_tests/custom_comments/__init__.py')
| -rw-r--r-- | tests/regressiontests/comment_tests/custom_comments/__init__.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/regressiontests/comment_tests/custom_comments/__init__.py b/tests/regressiontests/comment_tests/custom_comments/__init__.py new file mode 100644 index 0000000000..598927eace --- /dev/null +++ b/tests/regressiontests/comment_tests/custom_comments/__init__.py @@ -0,0 +1,32 @@ +from django.core import urlresolvers +from regressiontests.comment_tests.custom_comments.models import CustomComment +from regressiontests.comment_tests.custom_comments.forms import CustomCommentForm + +def get_model(): + return CustomComment + +def get_form(): + return CustomCommentForm + +def get_form_target(): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_submit_comment" + ) + +def get_flag_url(c): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_flag_comment", + args=(c.id,) + ) + +def get_delete_url(c): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_delete_comment", + args=(c.id,) + ) + +def get_approve_url(c): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_approve_comment", + args=(c.id,) + ) |
