def __eq__(self, other):
        return (isinstance(other, self.__class__) and
                other.package == self.package)
def allowed_file(filename):
    return '.' in filename and \
           filename.rsplit('.', 1)[1] in app.config.get('ALLOWED_EXTENSIONS')