-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Because a post always has a community:
https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/source/post.rs#L25
And a comment always has a post:
https://github.com/LemmyNet/lemmy/blob/main/crates/db_schema/src/source/comment.rs#L24
Maybe the pattern that is used in pymongo would work well here, I think it would simplify using plemmy.
https://pymongo.readthedocs.io/en/stable/tutorial.html
And users wouldn't have to think about the plemmy.response types like GetComunityResponse
from plemmy import PlemmyHTTP
client = PlemmyHTTP("https://lemmy.ml")
community = client['community_name'] or client.get_community(name=community_name)
community.create_post(post)
post = community[post_id] or community.get_post(post_id)
post.create_comment(comment)
You could still do:
client.create_post(community_id, post)
What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested