示例#1
0
def filter_by_tag(tag=""):
    connector = instance_connector()
    connector.connect()
    # get books without processing
    books = connector.get_books_by_tag(tag)
    # Lets normalize the list f books
    books = normalize_book(books, connector)
    connector.desconnect()
    return books
示例#2
0
def filter_by_book_name(book_name=""):
    """Filter by the name of the book"""
    connector = instance_connector()
    connector.connect()
    # get books without processing
    books = connector.get_book_by_name(book_name)
    # Lets normalize the list f books
    books = normalize_book(books, connector)
    connector.desconnect()
    return books
示例#3
0
def filter_by_collection(serie=""):
    connector = instance_connector()
    connector.connect()
    serie = urldecode(serie)
    # get books without processing
    books = connector.get_books_by_serie(serie)
    # Lets normalize the list f books
    books = normalize_book(books, connector)
    connector.desconnect()
    return books
示例#4
0
def get_books():
    """Get all books and normalize them
    :returns: list

    """
    connector = instance_connector()
    connector.connect()
    # get books without processing
    books = connector.get_all()
    # Lets normalize the list f books
    books = normalize_book(books, connector)
    connector.desconnect()
    return books
示例#5
0
def get_authors_with_url():
    """Get a list with all the authors"""
    authors = []

    connector = instance_connector()
    connector.connect()
    # Get authors without processing
    authors_raw = connector.get_authors()
    for author in authors_raw:
        autor_safe = urlencode(author)
        url = url_for('author_view', author_name=autor_safe)
        authors.append({'url': url, 'element': author})

    connector.desconnect()
    return authors
示例#6
0
def get_tags_with_url():
    """Get a list with all the tags"""
    tags = []

    connector = instance_connector()
    connector.connect()
    # Get tags without processing
    tags_raw = connector.get_tags()
    for tag in tags_raw:
        tag_safe = urlencode(tag)
        url = url_for('tag_view', tag_name=tag_safe)
        tags.append({'url': url, 'element': tag})

    connector.desconnect()
    return tags
示例#7
0
def get_collections_with_url():
    """Get a list with all the series"""
    series = []

    connector = instance_connector()
    connector.connect()
    # Get seriers without processing
    raw_series = connector.obtener_series()
    for serie in raw_series:
        serie_safe = urlencode(serie)
        url = url_for('collection_view', serie_name=serie_safe)
        series.append({'url': url, 'element': serie})

    connector.desconnect()
    return series