We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 067746c + fdfe404 commit ed317abCopy full SHA for ed317ab
django_pandas/utils.py
@@ -44,7 +44,13 @@ def replace_pk(model):
44
base_cache_key = get_base_cache_key(model)
45
46
def get_cache_key_from_pk(pk):
47
- return None if pk is None else base_cache_key % str(pk)
+ if pk is None:
48
+ return None
49
+ else:
50
+ try:
51
+ return base_cache_key % str(int(pk))
52
+ except:
53
+ return base_cache_key % str(pk)
54
55
def inner(pk_series):
56
pk_series = pk_series.astype(object).where(pk_series.notnull(), None)
0 commit comments