#42 Level for Users

This commit is contained in:
Leonhard Strohmidel
2021-10-01 09:28:45 +02:00
parent e52247d80b
commit 0852e35b57
3 changed files with 75 additions and 0 deletions

View File

@@ -29,6 +29,14 @@ def generate_profile_image_filename(instance, filename):
return 'explorers/' + str(instance.user.pk) + '-' + str(instance.user.username) + '.' + filename.split('.')[-1]
EXPLORER_LEVELS = (
(1, 'Newbie'),
(2, 'Scout'),
(3, 'Explorer'),
(4, 'Journalist'),
(5, 'Housekeeper')
)
class Explorer(models.Model):
"""
Profile that is linked to the Django user.
@@ -69,6 +77,11 @@ class Explorer(models.Model):
blank=True
)
level = models.IntegerField(
default=1,
choices=EXPLORER_LEVELS
)
def __str__(self):
return self.user.username