-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reply to post and tree-like organization of posts #227
Comments
That would appear to be the case. There isn't a 'reply to post' feature like on most forums. I too was looking for django forum software that did both the things you're asking about too ... |
I can confirm that
from machina.apps.forum_conversation.abstract_models import AbstractPost
class Post(AbstractPost):
reply_to = models.ForeignKey(
'Post', related_name='replies', on_delete=models.CASCADE
)
from machina.apps.forum_conversation.views import PostCreateView as BasePostCreateView
def quote_text(text):
lines = ['> ' + x for x in text.raw.splitlines()]
return '\n'.join(lines) + '\n\n'
class PostCreateView(BasePostCreateView):
def get_post_form_kwargs(self):
kwargs = super().get_post_form_kwargs()
if 'reply_to' in self.request.GET:
try:
post = Post.objects.get(pk=self.request.GET['reply_to'])
kwargs['reply_to'] = post
kwargs['initial'] = {'content': quote_text(post.content)}
except Exception as e:
logger.warning(e)
else:
kwargs['reply_to'] = None
return kwargs
|
Just checking if I have missed something obvious, is is true that
reply
in machina always replies to the topic, not particular post? In another word,The text was updated successfully, but these errors were encountered: