#42 Level for Users
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user