Ancestors

Written by Funky Bob on 2024-10-21 at 01:33

OK, what to work on today?

  1. replacing my hand rolled python-typing based Schema validator in my SSG with pydantic

  1. Learning to write custom rules in Fixit?

[#]python

=> More informations about this toot | More toots from FunkyBob@chaos.social

Written by Funky Bob on 2024-10-22 at 01:49

So I took a run at switching to Pydantic... and have run into a bit of a circular reference issue.

Every Content object has a reference to its Site, but Site contains all its Content objects.

If I make it a string, #pydantic ends up complaining "X is not fully defined".

How are people dealing with this?

=> More informations about this toot | More toots from FunkyBob@chaos.social

Toot

Written by Funky Bob on 2024-10-23 at 03:33

The only ways forward I can see right now with #pydantic are:

  1. mark the field as 'Any' and just get on with life

  1. detach the data model from the class operating on the data, since the Site isn't loaded from the data files, it's passed from the 'owner'.

=> More informations about this toot | More toots from FunkyBob@chaos.social

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113354630206329428
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
254.974769 milliseconds
Gemini-to-HTML Time
1.008566 milliseconds

This content has been proxied by September (3851b).