Beispiel #1
0
def countryLinkdataQuery(ID):
    results = sql_select("name AS label", TABLE_COUNTRIES, "id=" + str(ID))[0]
    results.update({
        "url":
        "tipsymix.com/api/countries/" + str(stdLookup(ID, TABLE_COUNTRIES)),
        "id":
        ID
    })
    return results
Beispiel #2
0
def brandLinkdataQuery(ID):
    results = sql_select("name AS label", TABLE_BRANDS, "id=" + str(ID))[0]
    results.update({
        "url":
        "tipsymix.com/api/brands/" + str(stdLookup(ID, TABLE_BRANDS)),
        "id":
        ID
    })
    return results
Beispiel #3
0
def cocktailLinkdataQuery(ID):
    results = sql_select("name AS label", TABLE_COCKTAILS, "id=" + str(ID))[0]
    results.update({
        "url":
        "tipsymix.com/api/cocktails/" + str(stdLookup(ID, TABLE_COCKTAILS)),
        "id":
        ID
    })
    return results
Beispiel #4
0
def ingredientLinkdataQuery(ID):
    results = sql_select("name AS label", TABLE_INGREDIENTS,
                         "id=" + str(ID))[0]
    results.update({
        "url":
        "tipsymix.com/api/ingredients/" +
        str(stdLookup(ID, TABLE_INGREDIENTS)),
        "id":
        ID
    })
    return results
Beispiel #5
0
def tagsInIngredientQuery(ID):
    return [
        match.get("tagID") for match in sql_select(
            "tagID", TABLE_TAGS_INGREDIENT, "ingredientID = " + str(ID))
    ]
Beispiel #6
0
def tagsInBrandQuery(ID):
    return [
        match.get("tagID")
        for match in sql_select("tagID", TABLE_TAGS_BRAND, "brandID = " +
                                str(ID))
    ]
Beispiel #7
0
def tagsInCocktailQuery(ID):
    return [
        match.get("tagID")
        for match in sql_select("tagID", TABLE_TAGS_COCKTAIL, "cocktailID = " +
                                str(ID))
    ]
Beispiel #8
0
def brandsInCountryQuery(ID):
    return [
        match.get("brandID") for match in sql_select(
            "brandID", TABLE_BRAND_COUNTRY, "countryID = " + str(ID))
    ]
Beispiel #9
0
def stdLookup(slug, type):
    a = sql_select("stdname", type, "id=" + str(slug))
    return a[0].get("stdname")
Beispiel #10
0
def fetchBrand(ID):
    return sql_select("*", TABLE_BRANDS, "id = " + str(ID))[0]
Beispiel #11
0
def fetchCocktail(ID):
    return sql_select("*", TABLE_COCKTAILS, "id = " + str(ID))[0]
Beispiel #12
0
def cocktailsInBrandQuery(ID):
    return [
        match.get("cocktailID") for match in sql_select(
            "cocktailID", TABLE_COCKTAIL_BRAND, "brandID = " + str(ID))
    ]
Beispiel #13
0
def ingredientsInBrandQuery(ID):
    return [
        match.get("ingredientID") for match in sql_select(
            "ingredientID", TABLE_INGREDIENT_BRAND, "brandID = " + str(ID))
    ]
Beispiel #14
0
def cocktailsInIngredientQuery(ID):
    return [
        match.get("cocktailID")
        for match in sql_select("cocktailID", TABLE_COCKTAIL_INGREDIENT,
                                "ingredientID = " + str(ID))
    ]
Beispiel #15
0
def tagsInCountryQuery(ID):
    return [
        match.get("tagID")
        for match in sql_select("tagID", TABLE_TAGS_COUNTRY, "countryID = " +
                                str(ID))
    ]
Beispiel #16
0
def countriesInBrandQuery(ID):
    return [
        match.get("countryID") for match in sql_select(
            "countryID", TABLE_BRAND_COUNTRY, "brandID = " + str(ID))
    ]
Beispiel #17
0
def tagQuery(ID):
    return sql_select("label", TABLE_TAGS, "id = " + str(ID))[0].get("label")
Beispiel #18
0
def ingredientsInCountryQuery(ID):
    return [
        match.get("ingredientID") for match in sql_select(
            "ingredientID", TABLE_INGREDIENT_COUNTRY, "countryID = " + str(ID))
    ]
Beispiel #19
0
def fetchIngredient(ID):
    return sql_select("*", TABLE_INGREDIENTS, "id = " + str(ID))[0]
Beispiel #20
0
def cocktailsInCountryQuery(ID):
    return [
        match.get("cocktailID") for match in sql_select(
            "cocktailID", TABLE_COCKTAIL_COUNTRY, "countryID = " + str(ID))
    ]
Beispiel #21
0
def fetchCountry(ID):
    return sql_select("*", TABLE_COUNTRIES, "id = " + str(ID))[0]
Beispiel #22
0
def idLookup(slug, type):
    a = sql_select("id", type, "stdname=" + str(slug))
    return int(a[0].get("id"))