-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport fix for not registering methods with names that
start with an '_' as views on REST, XMLRPC and JSON components.
- Loading branch information
1 parent
e5152a8
commit c3998e6
Showing
5 changed files
with
97 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
>>> methods = grok.util.public_methods_from_class(A) | ||
>>> sorted([m.__name__ for m in methods]) | ||
['should_also_be_public', 'should_be_public'] | ||
""" | ||
import grok | ||
import grok.util | ||
|
||
class A(object): | ||
|
||
def __init__(self): | ||
pass # this method is ignored | ||
|
||
def __call__(self): | ||
pass # this method is ignored | ||
|
||
def __double_underscored(self): | ||
pass # this method is ignored | ||
|
||
def _single_underscored(self): | ||
pass # this method is ignored | ||
|
||
def should_be_public(self): | ||
pass # this method is found | ||
|
||
def should_also_be_public(self): | ||
pass # this method is found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters