Show More
@@ -1653,12 +1653,27 b' class CacheInvalidation(Base, BaseModel)' | |||||
1653 | return u"<%s('%s:%s[%s]')>" % (self.__class__.__name__, |
|
1653 | return u"<%s('%s:%s[%s]')>" % (self.__class__.__name__, | |
1654 | self.cache_id, self.cache_key, self.cache_active) |
|
1654 | self.cache_id, self.cache_key, self.cache_active) | |
1655 |
|
1655 | |||
|
1656 | def _cache_key_partition(self): | |||
|
1657 | prefix, repo_name, suffix = self.cache_key.partition(self.cache_args) | |||
|
1658 | return prefix, repo_name, suffix | |||
|
1659 | ||||
1656 | def get_prefix(self): |
|
1660 | def get_prefix(self): | |
1657 | """ |
|
1661 | """ | |
1658 |
|
|
1662 | get prefix that might have been used in _get_cache_key to | |
1659 |
Only used for informational purposes |
|
1663 | generate self.cache_key. Only used for informational purposes | |
|
1664 | in repo_edit.html. | |||
1660 | """ |
|
1665 | """ | |
1661 | return self.cache_key.split(self.cache_args, 1)[0] |
|
1666 | # prefix, repo_name, suffix | |
|
1667 | return self._cache_key_partition()[0] | |||
|
1668 | ||||
|
1669 | def get_suffix(self): | |||
|
1670 | """ | |||
|
1671 | get suffix that might have been used in _get_cache_key to | |||
|
1672 | generate self.cache_key. Only used for informational purposes | |||
|
1673 | in repo_edit.html. | |||
|
1674 | """ | |||
|
1675 | # prefix, repo_name, suffix | |||
|
1676 | return self._cache_key_partition()[2] | |||
1662 |
|
1677 | |||
1663 | @classmethod |
|
1678 | @classmethod | |
1664 | def _get_cache_key(cls, key): |
|
1679 | def _get_cache_key(cls, key): |
General Comments 0
You need to be logged in to leave comments.
Login now