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

Docs should be better. #73

Open
nerdoc opened this issue Sep 15, 2022 · 2 comments
Open

Docs should be better. #73

nerdoc opened this issue Sep 15, 2022 · 2 comments

Comments

@nerdoc
Copy link
Contributor

nerdoc commented Sep 15, 2022

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.

  1. First, at templates.rst, you say room.channel.append(... - room in this case (a ModelStream 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?
  2. RoomListChannel isn't anything that can be referred to in the tutorial before, and is never explained. Is this a stream?
  3. The turbo_subscribe tag section should be before the usage of it.

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...

@nerdoc
Copy link
Contributor Author

nerdoc commented Sep 15, 2022

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:

  1. {% turbo_subscribe foo_model %} must be placed inside a template block, if you are using them:
{% block content %}
  ...
  {% turbo_subscribe foo_model %}
  ...
[% endblock %}

@scuml
Copy link
Contributor

scuml commented Sep 15, 2022

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.

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