Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions Menta/Profiles/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ class SkillInline(admin.StackedInline):
model = Skill

class ProfileAdmin(admin.ModelAdmin):
inlines = [
SkillInline,
]

admin.site.register(Profile)
admin.site.register(Skill)
list_filter = ('userType', 'gender', 'age')
list_display = ('firstName', 'lastName', 'userType', 'occupation')


admin.site.register(Profile, ProfileAdmin)
admin.site.register(Skill)

# admin.site.register(Profile, ProfileAdmin)
5 changes: 5 additions & 0 deletions Menta/Profiles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Skill(models.Model):
]
level= models.CharField(verbose_name='Proficiency', choices= SKILL_CHOICES, max_length=100, default= 'B')

def __str__(self):
return '{}'.format(self.skillName)

class Profile(models.Model):

Expand Down Expand Up @@ -45,3 +47,6 @@ class Profile(models.Model):
skills = models.ManyToManyField(Skill)

contact= models.EmailField(verbose_name= 'Contact email', max_length=100, null= False)

def __str__(self):
return '{}'.format(self.firstName)