Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…tive_hockey_federation into feature/add_pytest
  • Loading branch information
KonstantinRaikhert committed Dec 18, 2023
2 parents 2b40afb + dafdd2d commit 4993cac
Show file tree
Hide file tree
Showing 5 changed files with 422 additions and 498 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
1. [БРИФ](https://docs.google.com/document/d/1iHkA4Al-H-ppALPJDLMhb_Dl-ciRHH2npM6YRa2HQwg/edit)


1.2. [ER - диаграмма сущностей](docs/ER_Diagram.jpg)

1.1. [Инструкции и ритуалы на проекте](docs/materials/instructions.md)



1.2. [ER - диаграмма сущностей](docs/)
1.2. [ER - диаграмма сущностей](docs/ER_Diagram.jpg)



Expand Down
176 changes: 82 additions & 94 deletions adaptive_hockey_federation/main/admin.py
Original file line number Diff line number Diff line change
@@ -1,186 +1,174 @@
from django.contrib import admin
from main.models import (
City,
Competition,
Diagnosis,
Discipline,
Gender,
DisciplineLevel,
DisciplineName,
Document,
Nosology,
Player,
PlayerTeam,
Position,
Qualification,
StaffMember,
StaffTeamMember,
Team,
TeamCompetition,
Trainer,
TrainerTeam,
)


class PlayerInline(admin.TabularInline):
model = PlayerTeam


class TrainerInline(admin.TabularInline):
model = TrainerTeam


class CityAdmin(admin.ModelAdmin):
list_display = (
'pk',
'name'
)
search_fields = ('name',)
ordering = ['name']


class GenderAdmin(admin.ModelAdmin):
class NosologyAdmin(admin.ModelAdmin):
list_display = (
'pk',
'name'
)
search_fields = ('name',)
ordering = ['name']


class DisciplineAdmin(admin.ModelAdmin):
class DiagnosisAdmin(admin.ModelAdmin):
list_display = (
'pk',
'name'
'name',
'nosology'
)
search_fields = ('name',)
search_fields = (
'pk', 'name', 'nosology',)
ordering = ['name']


class PositionAdmin(admin.ModelAdmin):
class DisciplineNameAdmin(admin.ModelAdmin):
list_display = (
'pk',
'name'
)
search_fields = ('name',)
ordering = ['name']


class QualificationAdmin(admin.ModelAdmin):
class DisciplineLevelAdmin(admin.ModelAdmin):
list_display = (
'pk',
'name'
)
search_fields = ('name',)
ordering = ['name']


class TrainerTeamAdmin(admin.ModelAdmin):
class DisciplineAdmin(admin.ModelAdmin):
list_display = (
'trainer',
'team',
'pk',
'discipline_name',
'discipline_level'
)
search_fields = ('trainer', 'team',)
search_fields = ('discipline_name', 'discipline_level',)
ordering = ['discipline_name']


class TrainerAdmin(admin.ModelAdmin):
class DocumentAdmin(admin.ModelAdmin):
list_display = (
'pk',
'surname',
'name',
'patronymic',
'description',
'file'
)
search_fields = ('pk', 'surname', 'name', 'patronymic', 'description',)
search_fields = ('name', 'file',)
ordering = ['name']


class PlayerAdmin(admin.ModelAdmin):
class StaffMemberAdmin(admin.ModelAdmin):
list_display = (
'pk',
'surname',
'name',
'patronymic',
'date_of_birth',
'diagnosis',
'gender',
'identification_card',
)
search_fields = (
'pk',
'surname',
'name',
'patronymic',
'date_of_birth',
'diagnosis',
'gender',
'identification_card',
'phone'
)
search_fields = ('pk', 'surname', 'name', 'patronymic', 'phone',)


class DiagnosisAdmin(admin.ModelAdmin):
class StaffTeamMemberAdmin(StaffMemberAdmin):
list_display = (
'pk',
'class_name',
'is_wheeled',
'description',
'staff_member',
'staff_position',
'qualification',
'notes'
)
search_fields = (
'pk', 'class_name', 'description',)
'pk',
'staff_member',
'staff_position',
'qualification',
'notes'
)


class PlayerTeamAdmin(admin.ModelAdmin):
class PlayerAdmin(admin.ModelAdmin):
list_display = (
'pk',
'player',
'team',
'qualification',
'surname',
'name',
'patronymic',
'birthday',
'gender',
'diagnosis',
'discipline',
'level_revision',
'position',
'number',
'is_captain',
'is_assistent',
'identity_document',
)
search_fields = (
'pk', 'player', 'team', 'qualification',)


class CompetitionAdmin(admin.ModelAdmin):
list_display = (
'pk',
'city',
'surname',
'name',
'patronymic',
'birthday',
'gender',
'diagnosis',
'discipline',
'level_revision',
'position',
'number',
'date',
'duration',
'is_active',
'identity_document',
)
search_fields = (
'pk', 'city', 'number', 'duration',)
list_filter = ('date',)
ordering = ['surname', 'name', 'patronymic', 'birthday']


class TeamCompetitionAdmin(admin.ModelAdmin):
class TeamAdmin(admin.ModelAdmin):
list_display = (
'pk',
'team',
'competition',
'name',
'city',
'staff_team_member',
'discipline_name'
)
search_fields = (
'pk', 'team', 'competition',)


@admin.register(Team)
class TeamAdmin(admin.ModelAdmin):
list_display = (
'pk',
'name',
'city',
'discipline',
'composition',
'age',
'pk',
'staff_team_member',
'discipline_name'
)
search_fields = [
'pk', 'name', 'city', 'discipline', 'composition', 'age']
autocomplete_fields = ['city', 'discipline']
inlines = [PlayerInline, TrainerInline]
ordering = ['name']


admin.site.register(City, CityAdmin)
admin.site.register(Diagnosis, DiagnosisAdmin)
admin.site.register(Discipline, DisciplineAdmin)
admin.site.register(Gender, GenderAdmin)
admin.site.register(City, CityAdmin)
admin.site.register(DisciplineLevel, DisciplineLevelAdmin)
admin.site.register(DisciplineName, DisciplineNameAdmin)
admin.site.register(Document, DocumentAdmin)
admin.site.register(Nosology, NosologyAdmin)
admin.site.register(Player, PlayerAdmin)
admin.site.register(Position, PositionAdmin)
# admin.site.register(Team, TeamAdmin)
admin.site.register(Qualification, QualificationAdmin)
admin.site.register(PlayerTeam, PlayerTeamAdmin)
admin.site.register(Trainer, TrainerAdmin)
admin.site.register(TrainerTeam, TrainerTeamAdmin)
admin.site.register(Competition, CompetitionAdmin)
admin.site.register(TeamCompetition, TeamCompetitionAdmin)
admin.site.register(StaffTeamMember, StaffTeamMemberAdmin)
admin.site.register(StaffMember, StaffMemberAdmin)
admin.site.register(Team, TeamAdmin)
Loading

0 comments on commit 4993cac

Please sign in to comment.