Skip to content

admin

main.admin ¤

Admin module for the main app.

Classes¤

CompetencyAdmin ¤

Bases: ImportExportModelAdmin[Competency]

Admin class for the Competency model.

CompetencyDomainAdmin ¤

Bases: ImportExportModelAdmin[CompetencyDomain]

Admin class for the CompetencyDomain model.

CompetencyInline ¤

Bases: TabularInline[Competency, Competency]

Inline admin class for the Competency model.

CustomUserAdmin ¤

Bases: UserAdmin[User]

Override the UserAdmin to display extra fields.

CustomUserSkillsProfilesAdmin ¤

Bases: ModelAdmin[UserProxy]

Admin class for adding UserSkills in bulk to individual Users.

Methods:¤
has_add_permission(request) ¤

Do not allow adding new users from this view.

Source code in main/admin.py
204
205
206
def has_add_permission(self, request: HttpRequest) -> bool:
    """Do not allow adding new users from this view."""
    return False
has_delete_permission(request, obj=None) ¤

Do not allow deleting users from this view.

Source code in main/admin.py
208
209
210
211
212
def has_delete_permission(
    self, request: HttpRequest, obj: UserProxy | None = None
) -> bool:
    """Do not allow deleting users from this view."""
    return False

LearningResourceAdmin ¤

Bases: ImportExportModelAdmin[LearningResource]

Admin class for The LearningResource model.

Methods:¤
get_language_display(obj) ¤

Enable displaying multiple languages in the list display.

Source code in main/admin.py
122
123
124
125
@admin.display(description="language", ordering="language")
def get_language_display(self, obj: LearningResource) -> Any:
    """Enable displaying multiple languages in the list display."""
    return obj.get_language_display()

LearningResourceInline ¤

Bases: TabularInline[LearningResource, Provider]

Inline admin class for the LearningResource model.

ProviderAdmin ¤

Bases: ImportExportModelAdmin[Provider]

Admin class for The Provider model.

SkillAdmin ¤

Bases: ImportExportModelAdmin[Skill]

Admin class for the Skill model.

SkillInline ¤

Bases: TabularInline[Skill, Competency]

Inline admin class for the Skill model.

SkillLevelAdmin ¤

Bases: ImportExportModelAdmin[SkillLevel]

Admin class for The SkillLevel model.

ToolAdmin ¤

Bases: ImportExportModelAdmin[ToolLanguageMethodology]

Admin class for The Tool model.

ToolInline ¤

Bases: TabularInline[ToolLanguageMethodology, LearningResource]

Inline admin class for the Tool model.

UserProxy ¤

Bases: User

A proxy model of the User model to create a User Skills admin view.

This is required to make a second admin view tied to the User model.

Classes¤
Meta ¤

Make model a proxy and set verbose names.

UserSkillInline ¤

Bases: TabularInline[UserSkill, User]

Inline admin class for the UserSkill model.