Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use more readable app name on admin index page
- Loading branch information
1 parent
efdfe9d
commit 7953d5c
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class string_with_title(str): | ||
|
||
""" | ||
Custom string with title() method | ||
Based on code from | ||
https://ionelmc.wordpress.com/2011/06/24/custom-app-names | ||
""" | ||
|
||
def __new__(cls, value, title): | ||
instance = str.__new__(cls, value) | ||
instance._title = title | ||
return instance | ||
|
||
def title(self): | ||
return self._title | ||
|
||
def __copy__(self): | ||
return self | ||
|
||
def __deepcopy__(self, memodict): | ||
return self |