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

Setup ModelAdmin class for each model in Hosts app #150

Merged
merged 9 commits into from
Dec 3, 2016
Merged

Setup ModelAdmin class for each model in Hosts app #150

merged 9 commits into from
Dec 3, 2016

Conversation

gauthamzz
Copy link
Contributor

No description provided.



@admin.register(ChallengeHostTeam)
class HostTeamModelAdmin(TimeStampedAdmin):
Copy link
Member

Choose a reason for hiding this comment

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

class name should be ChallengeHostTeamAdmin. convention ideally is name of model + 'Admin'

# Register your models here.
from base.admin import TimeStampedAdmin

from .models import ChallengeHostTeam, ChallengeHost
Copy link
Member

Choose a reason for hiding this comment

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

lets write clean code. keep model imports alphabetically. also use tuple like

from .models import (ChallengeHost,
                     ChallengeHostTeam,)



@admin.register(ChallengeHost)
class HostModelAdmin(TimeStampedAdmin):
Copy link
Member

Choose a reason for hiding this comment

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

update class name here also.

Copy link
Member

Choose a reason for hiding this comment

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

@gauthamzz Can you replace the class name with ChallengeHostAdmin ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry i didnt see this 👎 one minute

@taranjeet
Copy link
Member

@gauthamzz : you need to properly rebase your branch from master. Let me know if you face any issue

@gauthamzz
Copy link
Contributor Author

@trojan i hope its okay now ?

# Register your models here.
from base.admin import TimeStampedAdmin

from .models import (ChallengeHostAdmin,
Copy link
Member

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 and ChallengeHost



@admin.register(ChallengeHostTeamAdmin)
class HostTeamModelAdmin(TimeStampedAdmin):
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 rename this class to ChallengeHostTeamAdmin

@admin.register(ChallengeHostTeamAdmin)
class HostTeamModelAdmin(TimeStampedAdmin):
list_display = ("team_name", "created_by")
list_filter = ("team_name", "created_by")
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 remove team_name from list_filter



@admin.register(ChallengeHostAdmin)
class HostModelAdmin(TimeStampedAdmin):
Copy link
Member

Choose a reason for hiding this comment

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

please rename this class to ChallengeHostAdmin


@admin.register(ChallengeHostAdmin)
class HostModelAdmin(TimeStampedAdmin):
list_display = ("user", "team_name", "status")
Copy link
Member

Choose a reason for hiding this comment

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

permissions can be added in list_display

@admin.register(ChallengeHostAdmin)
class HostModelAdmin(TimeStampedAdmin):
list_display = ("user", "team_name", "status")
list_filter = ("user", "team_name", "status")
Copy link
Member

Choose a reason for hiding this comment

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

lets give search by user and team_name and filter by status and permissios. can you please do these changes?

@gauthamzz
Copy link
Contributor Author

@trojan please review

@taranjeet
Copy link
Member

@gauthamzz thanks, will review it in night

@deshraj
Copy link
Member

deshraj commented Dec 3, 2016

@gauthamzz Let me know if you are working on it. We would like to get it done soon.

@gauthamzz
Copy link
Contributor Author

I have send pr Four days go . @trojan didnt review it yet for both #150 and #149

@deshraj
Copy link
Member

deshraj commented Dec 3, 2016

@gauthamzz Please check the comments above. There are some changes that need to be done so that we can merge it into master.



@admin.register(ChallengeHostTeam)
class HostTeamModelAdmin(TimeStampedAdmin):
Copy link
Member

@deshraj deshraj Dec 3, 2016

Choose a reason for hiding this comment

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

My bad. I forgot to comment here. Can you please replace HostTeamModelAdmin with ChallengeHostTeamModelAdmin?

Lets keep the name consistent throughout the codebase. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deshraj is it okay now ?

@deshraj deshraj merged commit 13151e9 into Cloud-CV:master Dec 3, 2016
@gauthamzz
Copy link
Contributor Author

@deshraj sorry it took so long

@deshraj
Copy link
Member

deshraj commented Dec 3, 2016

@gauthamzz No worries. Glad we merged it into master. :-)

@gauthamzz
Copy link
Contributor Author

can you review #149 also

@deshraj
Copy link
Member

deshraj commented Dec 3, 2016

Sure.

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.

None yet

3 participants