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

Add models and migrations for creating challenge using zip file. #1034

Merged

Conversation

RishabhJain2018
Copy link
Member

fixes #1033 @deshraj @taranjeet Please review the PR.

@deshraj deshraj requested review from deshraj and taranjeet June 8, 2017 09:29
@deshraj
Copy link
Member

deshraj commented Jun 8, 2017

This looks good to me. @trojan please review and then we can merge this.

from .models import (Challenge,
ChallengePhase,
DatasetSplit,
Leaderboard,
Copy link
Member

Choose a reason for hiding this comment

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

Can you please order the imports alphabetically?


@admin.register(ChallengeConfiguration)
class ChallengeConfigurationAdmin(TimeStampedAdmin):
list_display = ("user", "challenge", "zip_configuration", "is_created", "stdout_file", "stderr_file",)
Copy link
Member

Choose a reason for hiding this comment

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

There is no need of displaying all the fields in list_display. We can keep skip stdout and stderr. Also please move zip_configuration at the end.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah sure.

@admin.register(ChallengeConfiguration)
class ChallengeConfigurationAdmin(TimeStampedAdmin):
list_display = ("user", "challenge", "zip_configuration", "is_created", "stdout_file", "stderr_file",)
list_filter = ("user", "challenge", "is_created",)
Copy link
Member

Choose a reason for hiding this comment

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

Keeping a filter on challenge actually makes no sense because it is one to one field.

class ChallengeConfigurationAdmin(TimeStampedAdmin):
list_display = ("user", "challenge", "zip_configuration", "is_created", "stdout_file", "stderr_file",)
list_filter = ("user", "challenge", "is_created",)
search_fields = ("user", "challenge",)
Copy link
Member

Choose a reason for hiding this comment

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

Since we have a filter by challenge it makes no sense here.

Copy link
Member Author

@RishabhJain2018 RishabhJain2018 Jun 11, 2017

Choose a reason for hiding this comment

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

@taranjeet I think keeping challenge in search_fields will give us the flexibility to search for the zip file of that challenge and we can remove it from list_filter. What do you say?

"""
user = models.ForeignKey(User)
challenge = models.OneToOneField(Challenge)
zip_configuration = models.FileField(upload_to=RandomFileName("zip_configuration_files/challenge_zip"))
Copy link
Member

Choose a reason for hiding this comment

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

Can we please single quotes everywhere?

@RishabhJain2018
Copy link
Member Author

@deshraj @taranjeet Please review the PR.

@deshraj
Copy link
Member

deshraj commented Jun 11, 2017

LGTM.

@deshraj deshraj merged commit f2a3036 into Cloud-CV:master Jun 11, 2017
@RishabhJain2018 RishabhJain2018 deleted the zip-challenge-creation-models branch July 13, 2017 19:34
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.

Add models for creating challenge using zip file.
3 participants