File: util.py

package info (click to toggle)
django-redis 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 476 kB
  • sloc: python: 2,904; makefile: 6; sh: 6
file content (11 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
class CacheKey(str):
    """
    A stub string class that we can use to check if a key was created already.
    """

    def original_key(self) -> str:
        return self.rsplit(":", 1)[1]


def default_reverse_key(key: str) -> str:
    return key.split(":", 2)[2]