예제 #1
0
 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]
예제 #2
0
 def delete(self, **kwargs):
     object_filter = convert(Play(**kwargs), PlayDocument)
     PlayDocument.objects(**object_filter.to_dict()).delete()
예제 #3
0
 def delete(self, **kwargs):
     object_filter = convert(GameSummary(**kwargs), GameSummaryDocument)
     GameSummaryDocument.objects(**object_filter.to_dict()).delete()
예제 #4
0
 def create(self, creation_model: Play):
     document = convert(Play(**creation_model.dict()), PlayDocument)
     document.save()
     return convert(document, Play)
예제 #5
0
 def create(self, creation_model: GameSummary):
     document = convert(GameSummary(**creation_model.dict()),
                        GameSummaryDocument)
     document.save()
     return convert(document, GameSummary)