geldata / geldata/gel-python

handle recursion in model_dump

Open
#785 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
415
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Recursion should be possible:

```python
p = default.LinearPath(label="singleton")
p.next = p

client.save(p)
```

I'm enabling it in the next PR, but the bigger question is model_dump. It would crash unable to serialize data (the default behavior). We can do better -- we can detect recursion ourselves and stop it by returning a dict with just `id`.

Granted it would only work on models that were `save()`-ed, but that's the intended use case for model_dump anyway.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.