Introduce PathContains lookup to allow filtering against objects in path directly

This commit is contained in:
Jeremy Stretch
2020-10-06 09:41:45 -04:00
parent cd6b42be63
commit 9ce752f8d1
6 changed files with 21 additions and 16 deletions

View File

@@ -8,10 +8,6 @@ def object_to_path_node(obj):
return f'{obj._meta.model_name}:{obj.pk}'
def objects_to_path(*obj_list):
return [object_to_path_node(obj) for obj in obj_list]
def path_node_to_object(repr):
model_name, object_id = repr.split(':')
model_class = ContentType.objects.get(model=model_name).model_class()