예제 #1
0
파일: api.py 프로젝트: EvanKaminsky/idb
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
예제 #2
0
파일: api.py 프로젝트: EvanKaminsky/idb
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
예제 #3
0
파일: api.py 프로젝트: EvanKaminsky/idb
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
예제 #4
0
파일: api.py 프로젝트: EvanKaminsky/idb
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
예제 #5
0
파일: api.py 프로젝트: EvanKaminsky/idb
def tagsInIngredientQuery(ID):
    return [
        match.get("tagID") for match in sql_select(
            "tagID", TABLE_TAGS_INGREDIENT, "ingredientID = " + str(ID))
    ]
예제 #6
0
파일: api.py 프로젝트: EvanKaminsky/idb
def tagsInBrandQuery(ID):
    return [
        match.get("tagID")
        for match in sql_select("tagID", TABLE_TAGS_BRAND, "brandID = " +
                                str(ID))
    ]
예제 #7
0
파일: api.py 프로젝트: EvanKaminsky/idb
def tagsInCocktailQuery(ID):
    return [
        match.get("tagID")
        for match in sql_select("tagID", TABLE_TAGS_COCKTAIL, "cocktailID = " +
                                str(ID))
    ]
예제 #8
0
파일: api.py 프로젝트: EvanKaminsky/idb
def brandsInCountryQuery(ID):
    return [
        match.get("brandID") for match in sql_select(
            "brandID", TABLE_BRAND_COUNTRY, "countryID = " + str(ID))
    ]
예제 #9
0
파일: api.py 프로젝트: EvanKaminsky/idb
def stdLookup(slug, type):
    a = sql_select("stdname", type, "id=" + str(slug))
    return a[0].get("stdname")
예제 #10
0
파일: api.py 프로젝트: EvanKaminsky/idb
def fetchBrand(ID):
    return sql_select("*", TABLE_BRANDS, "id = " + str(ID))[0]
예제 #11
0
파일: api.py 프로젝트: EvanKaminsky/idb
def fetchCocktail(ID):
    return sql_select("*", TABLE_COCKTAILS, "id = " + str(ID))[0]
예제 #12
0
파일: api.py 프로젝트: EvanKaminsky/idb
def cocktailsInBrandQuery(ID):
    return [
        match.get("cocktailID") for match in sql_select(
            "cocktailID", TABLE_COCKTAIL_BRAND, "brandID = " + str(ID))
    ]
예제 #13
0
파일: api.py 프로젝트: EvanKaminsky/idb
def ingredientsInBrandQuery(ID):
    return [
        match.get("ingredientID") for match in sql_select(
            "ingredientID", TABLE_INGREDIENT_BRAND, "brandID = " + str(ID))
    ]
예제 #14
0
파일: api.py 프로젝트: EvanKaminsky/idb
def cocktailsInIngredientQuery(ID):
    return [
        match.get("cocktailID")
        for match in sql_select("cocktailID", TABLE_COCKTAIL_INGREDIENT,
                                "ingredientID = " + str(ID))
    ]
예제 #15
0
파일: api.py 프로젝트: EvanKaminsky/idb
def tagsInCountryQuery(ID):
    return [
        match.get("tagID")
        for match in sql_select("tagID", TABLE_TAGS_COUNTRY, "countryID = " +
                                str(ID))
    ]
예제 #16
0
파일: api.py 프로젝트: EvanKaminsky/idb
def countriesInBrandQuery(ID):
    return [
        match.get("countryID") for match in sql_select(
            "countryID", TABLE_BRAND_COUNTRY, "brandID = " + str(ID))
    ]
예제 #17
0
파일: api.py 프로젝트: EvanKaminsky/idb
def tagQuery(ID):
    return sql_select("label", TABLE_TAGS, "id = " + str(ID))[0].get("label")
예제 #18
0
파일: api.py 프로젝트: EvanKaminsky/idb
def ingredientsInCountryQuery(ID):
    return [
        match.get("ingredientID") for match in sql_select(
            "ingredientID", TABLE_INGREDIENT_COUNTRY, "countryID = " + str(ID))
    ]
예제 #19
0
파일: api.py 프로젝트: EvanKaminsky/idb
def fetchIngredient(ID):
    return sql_select("*", TABLE_INGREDIENTS, "id = " + str(ID))[0]
예제 #20
0
파일: api.py 프로젝트: EvanKaminsky/idb
def cocktailsInCountryQuery(ID):
    return [
        match.get("cocktailID") for match in sql_select(
            "cocktailID", TABLE_COCKTAIL_COUNTRY, "countryID = " + str(ID))
    ]
예제 #21
0
파일: api.py 프로젝트: EvanKaminsky/idb
def fetchCountry(ID):
    return sql_select("*", TABLE_COUNTRIES, "id = " + str(ID))[0]
예제 #22
0
파일: api.py 프로젝트: EvanKaminsky/idb
def idLookup(slug, type):
    a = sql_select("id", type, "stdname=" + str(slug))
    return int(a[0].get("id"))