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

Management command to create experiments/alternatives #180

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

Conversation

millar
Copy link
Contributor

@millar millar commented Apr 17, 2018

No description provided.

return

for alternative in options['alternatives']:
if ':' in alternative:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe better we include the : syntax in help message for parser?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea!

Copy link
Contributor

@lisongx lisongx left a comment

Choose a reason for hiding this comment

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

lgtm for other parts

try:
experiment = Experiment.objects.create(name=options['name'])
except IntegrityError:
self.stdout.write(self.style.ERROR("An experiment named '%s' already exists" % options['name']))
Copy link

@JonathanUsername JonathanUsername Jun 21, 2019

Choose a reason for hiding this comment

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

self.stderr is convention for errors surely

Copy link
Contributor Author

Choose a reason for hiding this comment

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

raise CommandError("Wibble failure")

Just checked docs and this might be the recommended practice

Choose a reason for hiding this comment

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

oooh

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

Successfully merging this pull request may close these issues.

3 participants