def get_random_object(model):
    """
    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 %}
    
    """
    try:
        return _get_model(model)._default_manager.order_by('?')[0]
    except __HOLE__:
        return ''
dataset/ETHPy150Open justquick/django-native-tags/native_tags/contrib/generic_content.py/get_random_object