import time


def user_media_path(instance, filename):
    """
    Returns the path to where a user uploaded file is saved.
    Has the form: user_<id>/YYYY/MMM/filename
    """
    return 'user_{0}/{1}/{2}/{3}'.format(instance.author.id,
                                        time.strftime('%Y'),
                                        time.strftime('%b'),
                                        filename)