1
0
Fork 0
mirror of https://github.com/shouptech/humulus.git synced 2026-02-03 18:19:42 +00:00

Add $type field

This commit is contained in:
Emma 2019-06-25 15:55:39 -06:00
parent 7f94fabd6d
commit d5e159c9b2
3 changed files with 7 additions and 1 deletions

View file

@ -170,7 +170,8 @@ class RecipeForm(FlaskForm):
'name': self.name.data,
'efficiency': str(self.efficiency.data),
'volume': str(self.volume.data),
'notes': self.notes.data
'notes': self.notes.data,
'$type': 'recipe',
}
recipe['fermentables'] = [f.doc for f in self.fermentables]

View file

@ -40,6 +40,7 @@ def app():
# Add a couple test recipe
put_doc({
'_id': 'awesome-lager',
'$type': 'recipe',
'efficiency': '65',
'name': 'Awesome Lager',
'notes': 'Test',
@ -49,6 +50,7 @@ def app():
})
put_doc({
'_id': 'partial-yeast-recipe',
'$type': 'recipe',
'efficiency': '75',
'name': 'Partial Beer',
'notes': 'Contains only required fields for yeast.',
@ -63,6 +65,7 @@ def app():
})
put_doc({
'_id': 'full-recipe',
'$type': 'recipe',
'efficiency': '78',
'name': 'Awesome Beer',
'notes': 'This is a test beer that contains most possible fields.',

View file

@ -162,6 +162,7 @@ def test_recipe_form_doc(app):
'notes': 'This is a test',
'fermentables': [],
'hops': [],
'$type': 'recipe',
}
ferm = FermentableForm()
@ -192,6 +193,7 @@ def test_recipe_form_doc(app):
'efficiency': '65',
'volume': '5.5',
'notes': 'This is a test',
'$type': 'recipe',
'fermentables': [{
'name': 'Test',
'type': 'Grain',