AnswerDotAI / fasthtml

The fastest way to create an HTML app
https://fastht.ml/
Apache License 2.0
5.27k stars 219 forks source link

Consider making session a SimpleNamespace #204

Closed jbellis closed 2 months ago

jbellis commented 2 months ago

It's just friendlier than a dict with string keys.

jph00 commented 2 months ago

Use fastcore's dict2obj if you prefer that.

jbellis commented 2 months ago

Are you open to a patch that wraps the Starlette session in an AttrDict?

jph00 commented 2 months ago

Hmm interesting idea. Could even do that to scope as well? I'm open to it -- feel free to give it a try, but test it lots because I'm slightly nervous that it could have some weird side effects (I don't know why I'm nervous about it... guess it's probably gonna be fine thinking more carefully...) I guess check that home-fasthtml, fh-about, stuff in fasthtml-example etc still all work ok.

jbellis commented 2 months ago

Okay, I'll give it a shot.

check that home-fasthtml, fh-about, stuff in fasthtml-example etc still all work ok

What repo are the first two in? I don't see any "home" or "about" files in this one or fasthtml-example.

jph00 commented 2 months ago

Those are all repo names in the answerdotai org.

Message ID: @.***>