def get_random_object(model):
try:<EOL><INDENT>return _get_model(model)._default_manager.order_by('<STR_LIT:?>')[<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>
Retrieves a random object from a given model, and stores it in a
context variable.

Syntax::

    {% get_random_object [app_name].[model_name] as [varname] %}

Example::

    {% get_random_object comments.freecomment as random_comment %}