Skip to content

Commit 4440e2a

Browse files
decided on MongoAlchemy, attempting to move forward with that
1 parent c1da7d3 commit 4440e2a

File tree

5 files changed

+59
-25
lines changed

5 files changed

+59
-25
lines changed

lib/app/dao/mongo.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/app/dao/query/RecipeQuery.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from import flask.ext.mongoalchemy import BaseQuery
2+
3+
class IngredientsQuery(BaseQuery):
4+
5+
def ingredientsInclude(self):
6+
return None
7+
8+
def ingredientsContainAll(self):
9+
return None
10+
11+
def tagsInclude(self):
12+
return None
13+
14+
def tagsInclude(self):
15+
return None
16+
17+
def titleIsLike(self):
18+
return None

lib/app/dao/recipe.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import json
2+
from app import db
3+
4+
5+
class Recipe(db.Document):
6+
title = db.StringField()
7+
filename=db.StringField()
8+
ingredients=db.ListField(db.StringField())
9+
tags=db.ListField(db.StringField)
10+
11+
def toJson(self):
12+
json.dumps(self.__dict__)
13+
14+

lib/app/obj/recipe.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

lib/app/routes.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,54 @@
44
from flask.json import jsonify
55
from flask import request
66

7-
@app.route('/',methods=['GET'])
7+
8+
@app.route('/', methods=['GET'])
89
@app.route('/status')
910
def index():
10-
response = {'status':"OK",'Time':datetime.datetime.now(),'project':'recipes'}
11+
response = {'status': "OK", 'Time': datetime.datetime.now(), 'project': 'recipes'}
1112
return jsonify(response)
1213

13-
@app.route('/search/byTags',methods=['GET'])
14+
15+
@app.route('/search/byTags', methods=['GET'])
1416
def searchByTags():
1517
return jsonify("{}")
1618

17-
@app.route("/search/all",methods=['GET'])
19+
20+
@app.route('/search/byTags/all', methods=['GET'])
21+
def searchByTags():
22+
return jsonify("{}")
23+
24+
25+
@app.route("/search/all", methods=['GET'])
1826
def getAll():
1927
return jsonify("{}")
2028

21-
@app.route("/search/ingredients",methods=['GET'])
29+
30+
@app.route("/search/ByIngredients", methods=['GET'])
2231
def searchByIngredients():
2332
return jsonify("{}")
2433

25-
@app.route("/recipes/put",methods=['PUT'])
34+
35+
@app.route("/search/ByIngredients/all", methods=['GET'])
36+
def searchByIngredients():
37+
return jsonify("{}")
38+
39+
40+
@app.route("/recipes/put", methods=['PUT'])
2641
def addRecipe():
2742
return jsonify("{}")
2843

29-
@app.route("/recipes/edit",methods=['POST'])
44+
45+
@app.route("/recipes/edit", methods=['POST'])
3046
def editRecipe():
3147
return jsonify("{}")
3248

33-
@app.route('/recipes/tags',methods=['GET'])
49+
50+
@app.route('/recipes/tags', methods=['GET'])
3451
def getTags():
3552
return jsonify("{}")
3653

37-
@app.route('/recipes/ingredients',methods=['GET'])
54+
55+
@app.route('/recipes/ingredients', methods=['GET'])
3856
def getIngredients():
3957
return jsonify("{}")
40-

0 commit comments

Comments
 (0)