Skip to content
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

How to migrate from django-comments-xtd? #36

Open
jdbit opened this issue Jul 15, 2022 · 7 comments
Open

How to migrate from django-comments-xtd? #36

jdbit opened this issue Jul 15, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@jdbit
Copy link

jdbit commented Jul 15, 2022

Hi, could you please tell me how to migrate from 2.x to 3.x? As far as I understand, I'll lose likes/dislikes from the xtd, but it's not a problem. Should I just dump the data from django-comments-xtd, rename the table names in the json file, and load the data to django-comments-ink?

@danirus
Copy link
Member

danirus commented Jul 15, 2022

Hi, That could be better done using a management command. The DB schema of django-comments-ink is different from the schema of django-comments-xtd. The likes/dislikes have to be converted into CommentReactions, and XtdComment's into InkComment's referring to CommentThread's.

@danirus danirus self-assigned this Jul 15, 2022
@danirus danirus added the enhancement New feature or request label Jul 15, 2022
@jdbit
Copy link
Author

jdbit commented Jul 15, 2022

Thank you for your reply. I replaced django_comments_xtd.xtdcomment to django_comments_ink.inkcomment in the json file I dumped by ./manage.py dumpdata django_comments_xtd > comments.json command and than loaded the json file. Looks like it works. I don't care about likes/dislikes so I didn't convert them into ComentReaction.

Everything works, except nothing happens when I click the React button. I included the javascript, no errors in the js console, but no reactions modal either.

@danirus
Copy link
Member

danirus commented Jul 16, 2022

The current schema for InkComment, implemented in migration 0000 will change and it won't be covered in a new migration but rather change in the migration 0000 itself. That's why I added the "Don't use it yet" in the readme. Be aware of it because you won't be able to update via migrations.

When the app is ready I will update the docs. Meanwhile you could look at the dci-project-stories repo to see the templates and how they work with the plugin. The reason why you don't see the reactions panel most probably has to do with that. You need to provide the reactions panel template via the use of a template-tag.

@jdbit
Copy link
Author

jdbit commented Jul 16, 2022

Fixed reactions modal by adding modal.css and reacitons.css, looks like everything works now. Okay, I'll wait at least until this migration will be applied. Nice app by the way! Thank you for your help.

@Hopiu
Copy link

Hopiu commented Sep 13, 2022

The current schema for InkComment, implemented in migration 0000 will change and it won't be covered in a new migration but rather change in the migration 0000 itself. That's why I added the "Don't use it yet" in the readme. Be aware of it because you won't be able to update via migrations.

When the app is ready I will update the docs. Meanwhile you could look at the dci-project-stories repo to see the templates and how they work with the plugin. The reason why you don't see the reactions panel most probably has to do with that. You need to provide the reactions panel template via the use of a template-tag.

Do you have a rough plan on when a first usable release will be ready? We'd like to use django-comments-ink in a project and are willing to help you getting the most important changes done. (If you are open for help)

@rollue
Copy link

rollue commented Dec 9, 2022

The current schema for InkComment, implemented in migration 0000 will change and it won't be covered in a new migration but rather change in the migration 0000 itself. That's why I added the "Don't use it yet" in the readme. Be aware of it because you won't be able to update via migrations.
When the app is ready I will update the docs. Meanwhile you could look at the dci-project-stories repo to see the templates and how they work with the plugin. The reason why you don't see the reactions panel most probably has to do with that. You need to provide the reactions panel template via the use of a template-tag.

Do you have a rough plan on when a first usable release will be ready? We'd like to use django-comments-ink in a project and are willing to help you getting the most important changes done. (If you are open for help)

Wondering the same, too - planning to implement comments for our service. Still deciding whether we should use django-comments-xtd, django-comments-ink(which seems like django-comments-xtd 3.x release version), or even try to write from scratch with postgres ltree.

@rollue
Copy link

rollue commented Dec 9, 2022

Out of curiosity - what is the point of a separate CommentThread model like below?

class CommentThread(models.Model):

Django-comment-xtd had the thread id as a field in the XtdComment model.
https://github.com/danirus/django-comments-xtd/blob/557c771b595e2a4ac6dcfba2ab2b237572720d6d/django_comments_xtd/models.py#L63

It looks like field/model is used to save a reference to the "post" instance that the comments belong too. But the Comment model from Django's original contrib comment already has a generic FK to the "post" or the "thread" object. Am I understanding this correctly?

@danirus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants