class PGDatabaseConnector(implements(DatabaseInterface)): def fetchIngredientsFromSearch(self, term, limit): results = PGDatabase().getIngredientsFromSearchTerm(term, limit) return results def createRecipe(self, recipe): if not recipe.name: raise MissingRecipeField("Missing name") if not recipe.servingSize: raise MissingRecipeField("Missing serving size") if not recipe.cuisine: raise MissingRecipeField("Missing cuisine") if not recipe.mealType: raise MissingRecipeField("Missing meal type") if not recipe.ingredients: raise MissingRecipeField("Missing ingredients") PGDatabase().insertRecipe(recipe.name, recipe.servingSize, recipe.cuisine, recipe.mealType, recipe.ingredients)
class Cash(implements(Payment)): def execute(self): print("Cash On")
class Bkash(implements(Payment)): def execute(self): print("Bkash")
class Rocket(implements(Payment)): def execute(self): print("Rocket")
class Circle(implements(Shape)): def draw() -> Shape: print('Circle is created')
class AnotherShape(implements(Shape)): def draw() -> Shape: print('Another shape is created')
class Triangle(implements(Shape)): def draw() -> Shape: print('Triangle is created')
class Rectangle(implements(Shape)): def draw() -> Shape: print('Rectangle is created')