def friendly_repr(obj, *attributes):
    """Render a human friendly representation of a database model instance."""
    values = []
    for name in attributes:
        try:
            value = getattr(obj, name, None)
            if value is not None:
                values.append('%s=%r' % (name, value))
        except Exception:
            pass
    return '%s(%s)' % (obj.__class__.__name__, ', '.join(values))
