airlog / flavority-api

RESTful API for the tastiest website
0 stars 1 forks source link

Błędne generowanie przepisów do bazy #12

Closed robin92 closed 10 years ago

robin92 commented 10 years ago

Wygenerowałem nową bazę danych korzystając z naszych skryptów i otrzymałem błędnie wypełnione dane. Problem można zauważyć na załączonym screenie screenshot from 2014-05-25 11 55 53

Klient otrzymał następujące dane z serwera

{
    "author_id": 1, 
    "author_name": "user0@gmail.com", 
    "creation_date": "", 
    "difficultyMark": "", 
    "dish_name": "Braised Corned Beef Brisket", 
    "eventToAdminControl": "", 
    "id": 2, 
    "ingredients": [
        {
            "amount": 1, 
            "ingr_name": "flat-cut corned beef brisket", 
            "unit_name": "pound)"
        }, 
        {
            "amount": 1, 
            "ingr_name": "browning sauce (such as Kitchen Bouquet\u00ae), or as desired", 
            "unit_name": "tablespoon"
        }, 
        {
            "amount": 1, 
            "ingr_name": "vegetable oil", 
            "unit_name": "tablespoon"
        }, 
        {
            "amount": 1, 
            "ingr_name": "onion, sliced", 
            "unit_name": ""
        }, 
        {
            "amount": 6, 
            "ingr_name": "garlic, sliced", 
            "unit_name": "cloves"
        }, 
        {
            "amount": 2, 
            "ingr_name": "water", 
            "unit_name": "tablespoons"
        }
    ], 
    "portions": "Preheat oven to 275 degrees F (135 degrees C).\nDiscard any flavoring packet from corned beef. Brush brisket with browning sauce on both sides. Heat vegetable oil in a large skillet over medium-high heat and brown brisket on both sides in the hot oil, 5 to 8 minutes per side.\nPlace brisket on a rack set in a roasting pan. Scatter onion and garlic slices over brisket and add water to roasting pan. Cover pan tightly with aluminum foil.\nRoast in the preheated oven until meat is tender, about 6 hours.", 
    "preparation_time": "", 
    "rank": "", 
    "recipe_text": "6+  hrs", 
    "tags": [...], 
    "tasteMark": ""
}

A w bazie danych wygląda to tak:

id          dish_name                    author_id   creation_date  preparation_time  recipe_text  tasteMark   difficultyMark  rank        eventToAdminControl  portions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
----------  ---------------------------  ----------  -------------  ----------------  -----------  ----------  --------------  ----------  -------------------  ---------------------------------------------------------------------------------------------                                                                                                                                                                                                                                                                                                                                                                                                                        
2           Braised Corned Beef Brisket  1                                            6+  hrs                                                                   Preheat oven to 275 degrees F (135 degrees C).
Discard any flavoring packet from corned beef. Brush brisket with browning sauce on both sides. Heat vegetable oil in a large skillet over medium-high heat and brown brisket on both sides in the hot oil, 5 to 8 minutes per side.
Place brisket on a rack set in a roasting pan. Scatter onion and garlic slices over brisket and add water to roasting pan. Cover pan tightly with aluminum foil.
Roast in the preheated oven until meat is tender, about 6 hours.

Wygląda więc na to, że zawiódł skrypt generujący dane. Moją bazę danych można pobrać stąd

FilipJany commented 10 years ago

W czwartek pisalem ze blad jest w skrypcie, ale widocznie nie doszlo do nikogo, szkoda.... Wydaje mi sie jednak, ze naprawa tego jest prosta, wystarczylo by pozamieniac argumenty w pliku create_database.py w linii 23 (tam gdzie tworzony jest nowy przepis)

robin92 commented 10 years ago

Wygrałeś przypisanie do naprawy buga :-)

FilipJany commented 10 years ago

well fuck.....

2014-05-25 12:31 GMT+02:00 Rafal notifications@github.com:

Wygrałeś przypisanie do naprawy buga :-)

— Reply to this email directly or view it on GitHubhttps://github.com/robin92/flavority-api/issues/12#issuecomment-44127840 .

Pozdrawiam, Filip Jany

illa commented 10 years ago

@robin92 jeśli prześledzić plik model.py to widać, że ty ostatnio zmieniłeś konstruktor Recipe :) Myślę, że najłatwiej zmienić odpowiednio kolejność argumentów w skrypcie ;)