@classmethod
def tablename(cls):
    """Returns the tablename set for the class, if one is not set, then
        we default to the lowercase version of the class name.

        """
    if cls.__tablename__ is not None:
        return cls.__tablename__
    return cls.__name__.lower()
