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

[WIP] Implement project cloning; fixes #689 #796

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ethan-nelson
Copy link
Collaborator

@ethan-nelson ethan-nelson commented May 10, 2016

Brought up in #689 is a requested functionality to clone projects.

I've implemented this in a somewhat mechanical way. After a user specifies a project to clone on the new project splash screen, the project_clone view goes through and copies all of the old attributes, columns, and tasks. The only things unique in the new project attributes are the id number (assigned when the new model is initialized) and possibly the author if the cloner is not the original author.

Old tasks are used to initialize new tasks with the corresponding project number, as are priority areas and translations.

Work in progress so I haven't written tests.

Let me know about any comments so far.

  • Placeholder for other things I will likely think of later

@ethan-nelson ethan-nelson force-pushed the clone-project branch 2 times, most recently from 3188915 to b8e6309 Compare May 10, 2016 03:48
@coveralls
Copy link

Coverage Status

Coverage decreased (-2.01%) to 92.857% when pulling d1c58c8 on ethan-nelson:clone-project into cb482d6 on hotosm:master.

'invalidated', 'last_update',
'priority_areas', 'status',
'tasks', 'validated']):
setattr(new_project, att, getattr(old_project, att))
Copy link
Collaborator Author

@ethan-nelson ethan-nelson May 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole for section feels a bit hacky, but the only other solution I could come up with is supply a list of attributes to choose as opposed to ignore.

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

Successfully merging this pull request may close these issues.

2 participants