Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

ModelStream as Mixin? #60

Open
nerdoc opened this issue May 13, 2022 · 4 comments
Open

ModelStream as Mixin? #60

nerdoc opened this issue May 13, 2022 · 4 comments

Comments

@nerdoc
Copy link
Contributor

nerdoc commented May 13, 2022

I do not get the full purposes of ModelStream and Component, docs are not fully comprehensive for me here. If I understand correctly, you can add a Meta class to any Stream (even Component?) with a model attribute, and Turbo will connect pre_save/_delete etc. signals to that model.

Then why do you have a ModelStream class to inherit from?

Wouldn't it be possible to implement ModelStream as Mixin? So you can add it to a Component too?

Or am I thinking wrong here?

@scuml
Copy link
Contributor

scuml commented May 14, 2022

You make good points. Let me mull that over. Thanks.

@nerdoc
Copy link
Contributor Author

nerdoc commented May 14, 2022

Thanks. I've searched for years for such a project. Already experimented with sockpuppet, HTMX, unpoly, Unicorn, alpine.js and some others. And turbo-django is definitely the best, hands down. Really great software, very clean design.
IMHO just lacks some documentation for newcomers (it assumes a bit too much knowledge; =steep learning courve), and some helpers for often needed (CRUD) tasks.
But, with my full respect, this project is really cool.
Greetings from Salzburg.

@nerdoc
Copy link
Contributor Author

nerdoc commented May 14, 2022

You make good points. Let me mull that over. Thanks.

Ah, and: You could even keep the ModelStream classes.

class ModelStreamMixin:
    ...

class ModelStream(ModelStreamMixin, Stream):
    pass

class ModelStreamComponent(ModelStreamMixin, BaseComponent):
    pass

Maybe you find better names.

@scuml
Copy link
Contributor

scuml commented May 14, 2022

I'm coming from a similar place. I think this tech has extraordinary potential, just needs some polish and as you mentioned, clear documentation and examples. I'll keep chipping away at it, and hopefully the community will join in help sell more people on this project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants