From 40bf4d579cb30a83b0b730c0038130037728f8db Mon Sep 17 00:00:00 2001 From: davebshow <davebshow@gmail.com> Date: Sat, 2 Jul 2016 22:17:04 -0400 Subject: [PATCH] simplified mapper --- goblin/mapper.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/goblin/mapper.py b/goblin/mapper.py index bf54b2c..ce4cfe0 100644 --- a/goblin/mapper.py +++ b/goblin/mapper.py @@ -37,14 +37,11 @@ def map_edge_to_ogm(result, element, mapping): # DB <-> OGM Mapping def create_mapping(namespace, properties): - elem_type = namespace.get('__type__', None) - if elem_type == 'vertex': - return VertexMapping(namespace, properties) - elif elem_type == 'edge': - return EdgeMapping(namespace, properties) + if namespace.get('__type__', None): + return Mapping(namespace, properties) -class VertexMapping: +class Mapping: def __init__(self, namespace, properties): self._label = namespace.get('__label__', None) @@ -74,7 +71,3 @@ class VertexMapping: self._type, self._label, self._properties) - - -class EdgeMapping(VertexMapping): - pass -- GitLab