jmoiron/johnny-cache — pull request #50 by Wilfred (2014-01-22 11:42:11+00:00)
Title: Don't return the wrong cached value if parameters happen to be prefixes

Johnny Cache builds a cache key by repeatedly calling `key.update`. This is equivalent to concatenating all the parameters together and generating a hash.

As a result, Johnny Cache confuses the following queries:

Foo.objects.get(x="foo", y="bar")
Foo.objects.get(x="foob", y="ar")

Bar.objects.get(x=1, y=21)
Bar.objects.get(x=12, y=1)

This pull request inserts a separator between parameters, so we don't get confused. This code is heavily based on the patch written by @milos-u.