-
Notifications
You must be signed in to change notification settings - Fork 782
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
Add models and migrations for creating challenge using zip file. #1034
Conversation
This looks good to me. @trojan please review and then we can merge this. |
apps/challenges/admin.py
Outdated
from .models import (Challenge, | ||
ChallengePhase, | ||
DatasetSplit, | ||
Leaderboard, |
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.
Can you please order the imports alphabetically?
apps/challenges/admin.py
Outdated
|
||
@admin.register(ChallengeConfiguration) | ||
class ChallengeConfigurationAdmin(TimeStampedAdmin): | ||
list_display = ("user", "challenge", "zip_configuration", "is_created", "stdout_file", "stderr_file",) |
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.
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.
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.
yeah sure.
apps/challenges/admin.py
Outdated
@admin.register(ChallengeConfiguration) | ||
class ChallengeConfigurationAdmin(TimeStampedAdmin): | ||
list_display = ("user", "challenge", "zip_configuration", "is_created", "stdout_file", "stderr_file",) | ||
list_filter = ("user", "challenge", "is_created",) |
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.
Keeping a filter on challenge actually makes no sense because it is one to one field.
apps/challenges/admin.py
Outdated
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",) |
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.
Since we have a filter by challenge it makes no sense here.
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.
@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?
apps/challenges/models.py
Outdated
""" | ||
user = models.ForeignKey(User) | ||
challenge = models.OneToOneField(Challenge) | ||
zip_configuration = models.FileField(upload_to=RandomFileName("zip_configuration_files/challenge_zip")) |
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.
Can we please single quotes everywhere?
@deshraj @taranjeet Please review the PR. |
LGTM. |
fixes #1033 @deshraj @taranjeet Please review the PR.