Fixed #12982 -- Added a ``get_or_set`` method to the BaseCache backend.

https://code.djangoproject.com/ticket/12982
I think @chicheng means doing the equivalent of {{cache.get_or_set('some-timestamp-key', datetime.datetime.now)}}