def get(self, **kwargs): modifiers, query_parameters = extract_query_modifiers(kwargs) object_filter = convert(Play(**query_parameters), PlayDocument) query_set = build_queryset( PlayDocument, model_filter_properties=object_filter.to_dict(), **modifiers) return [convert(game_document, Play) for game_document in query_set]
def delete(self, **kwargs): object_filter = convert(Play(**kwargs), PlayDocument) PlayDocument.objects(**object_filter.to_dict()).delete()
def delete(self, **kwargs): object_filter = convert(GameSummary(**kwargs), GameSummaryDocument) GameSummaryDocument.objects(**object_filter.to_dict()).delete()
def create(self, creation_model: Play): document = convert(Play(**creation_model.dict()), PlayDocument) document.save() return convert(document, Play)
def create(self, creation_model: GameSummary): document = convert(GameSummary(**creation_model.dict()), GameSummaryDocument) document.save() return convert(document, GameSummary)