-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Change: when forking a query, copy all visualizations #1256
Conversation
@@ -715,6 +715,32 @@ def recent(cls, groups, user_id=None, limit=20): | |||
|
|||
return query | |||
|
|||
@classmethod | |||
def fork(cls, id, user, org): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why class method and not an instance method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that fork logic (fetch query and chart data by query id, then change their name and id, then insert them) should be model's method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway the fork
method shouldn't fetch the query. It will either operate on itself (if it's an instance method) or on a given query (if we keep it as a class method).
What benefit we have from having this as a class method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, change instance methdo
@ninneko have you seen my comments? |
Sorry, I was not able to commit because I have been sick. |
Sorry to hear that. I hope you're feeling better now! No pressure with the pull request. Just wanted to make sure you noticed the Thanks. On Sep 15, 2016 11:01 AM, "yohei.naruse" notifications@github.com wrote:
|
7fc8597
to
7bc71c9
Compare
@ninneko you need to update the tests, because they still use the class method instead of instance method. |
Change: when forking a query, copy all visualizations
Closes #439.