Compare commits
2 Commits
c63b0ebb87
...
fefc38fa9c
Author | SHA1 | Date | |
---|---|---|---|
|
fefc38fa9c | ||
|
58ab70ba42 |
1
Pipfile
1
Pipfile
@ -27,4 +27,5 @@ server = "django_lostplaces/manage.py runserver --ipv6"
|
|||||||
dbshell = "django_lostplaces/manage.py dbshell"
|
dbshell = "django_lostplaces/manage.py dbshell"
|
||||||
showmigrations = "django_lostplaces/manage.py showmigrations"
|
showmigrations = "django_lostplaces/manage.py showmigrations"
|
||||||
makemigrations = "django_lostplaces/manage.py makemigrations --no-input"
|
makemigrations = "django_lostplaces/manage.py makemigrations --no-input"
|
||||||
|
migrate = "django_lostplaces/manage.py migrate"
|
||||||
build = "django_lostplaces/setup.py bdist_wheel --universal"
|
build = "django_lostplaces/setup.py bdist_wheel --universal"
|
||||||
|
18
django_lostplaces/lostplaces/migrations/0009_place_level.py
Normal file
18
django_lostplaces/lostplaces/migrations/0009_place_level.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.1.1 on 2021-10-01 07:38
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('lostplaces', '0008_explorer_level'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='place',
|
||||||
|
name='level',
|
||||||
|
field=models.IntegerField(choices=[(1, 'Ruin'), (2, 'Vandalized'), (3, 'Natures Treasure'), (4, 'Long Time no See'), (5, 'Time Capsule')], default=5),
|
||||||
|
),
|
||||||
|
]
|
@ -11,6 +11,13 @@ from lostplaces.models.abstract_models import Submittable, Taggable, Mapable
|
|||||||
from easy_thumbnails.fields import ThumbnailerImageField
|
from easy_thumbnails.fields import ThumbnailerImageField
|
||||||
from easy_thumbnails.files import get_thumbnailer
|
from easy_thumbnails.files import get_thumbnailer
|
||||||
|
|
||||||
|
PLACE_LEVELS = (
|
||||||
|
(1, 'Ruin'),
|
||||||
|
(2, 'Vandalized'),
|
||||||
|
(3, 'Natures Treasure'),
|
||||||
|
(4, 'Long Time no See'),
|
||||||
|
(5, 'Time Capsule')
|
||||||
|
)
|
||||||
|
|
||||||
class Place(Submittable, Taggable, Mapable):
|
class Place(Submittable, Taggable, Mapable):
|
||||||
"""
|
"""
|
||||||
@ -34,6 +41,11 @@ class Place(Submittable, Taggable, Mapable):
|
|||||||
related_name='place_heros'
|
related_name='place_heros'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
level = models.IntegerField(
|
||||||
|
default=5,
|
||||||
|
choices=PLACE_LEVELS
|
||||||
|
)
|
||||||
|
|
||||||
def get_hero_image(self):
|
def get_hero_image(self):
|
||||||
if self.hero:
|
if self.hero:
|
||||||
return self.hero
|
return self.hero
|
||||||
|
Loading…
Reference in New Issue
Block a user