Open nerdoc opened 2 years ago
Like always, I find the solution to my problems a few minutes after posting the question to stackoverflow or filing a bug, and after hours/days of searching/debugging. But it discovers another missing hint to add to the docs:
{% turbo_subscribe foo_model %}
must be placed inside a template block, if you are using them:
{% block content %}
...
{% turbo_subscribe foo_model %}
...
[% endblock %}
The docs do indeed need some extra attention.
(1) - Yes, room.channel
is now room.stream
(2) - To keep with naming conventions, RoomListChannel
should be renamed to RoomListStream
. And example of the Stream class itself would be helpful.
(4) is related to how django templates work in general. If using an extended template, all template tags and html with the exception of {% load %}
must exist inside templates. I'd view this as out of scope for turbo docs, but maybe the problem is with the name of the tag - tubo_subscribe_tag
may better signify what is being inserted and remove confusion.
A section dedicated to Turbo + Django development patterns would be immensely helpful as well. I'm keeping track of a few to add.
I can't get turbo_django (Model)streams to work. Components work, but my ModelStream refuses doing what I want. I suppose there are some errors in the documentation, and at least it should be improved here.
room.channel.append(...
- room in this case (aModelStream
instance) has no "channel" attr. Maybe you mean "stream" here? But there are other things that are missing. "..., or pass a Django instance..." is a bit weird. I think you mean a Model instance that has a stream attached?RoomListChannel
isn't anything that can be referred to in the tutorial before, and is never explained. Is this a stream?If you help me a bit to understand I could try to reorganize and corect this page for "newcomers" like me. But I need help - because, like I said, using the docs, I can't get ModelStream to work...