-
Notifications
You must be signed in to change notification settings - Fork 780
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
Setup ModelAdmin class for each model in Hosts app #150
Changes from 5 commits
2de204b
b1cbe25
aef378b
d609672
a9f8012
270704a
0a92a86
7b1bdf4
72d8de0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. | ||
from base.admin import TimeStampedAdmin | ||
|
||
from .models import (ChallengeHostAdmin, | ||
ChallengeHostTeamAdmin) | ||
|
||
|
||
@admin.register(ChallengeHostTeamAdmin) | ||
class HostTeamModelAdmin(TimeStampedAdmin): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. class name should be ChallengeHostTeamAdmin. convention ideally is name of model + 'Admin' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you please rename this class to ChallengeHostTeamAdmin There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad. I forgot to comment here. Can you please replace Lets keep the name consistent throughout the codebase. :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @deshraj is it okay now ? |
||
list_display = ("team_name", "created_by") | ||
list_filter = ("team_name", "created_by") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you please remove |
||
search_fields = ("team_name", "created_by") | ||
|
||
|
||
@admin.register(ChallengeHostAdmin) | ||
class HostModelAdmin(TimeStampedAdmin): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. update class name here also. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gauthamzz Can you replace the class name with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry i didnt see this 👎 one minute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please rename this class to |
||
list_display = ("user", "team_name", "status") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. permissions can be added in list_display |
||
list_filter = ("user", "team_name", "status") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets give search by |
||
search_fields = ("user", "team_name", "status") |
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.
wrong import. model name concerned here are
ChallengeHostTeam
andChallengeHost