@classmethod
def from_cache(cls, data):
    """Populates a page using cached attributes where possible"""
    if 'filename' not in data:
        raise ValueError('from_cache must receive at least the filename')
    c = cls(data['filename'])
    for k in cls.__dict__:
        if k.startswith('_'):
            continue
        if k in data:
            v = data[k]
            c.__dict__[k] = v
    return c
