Merge remote-tracking branch 'ungleich-public/master'
This commit is contained in:
commit
0e5a7fb2c8
8 changed files with 112 additions and 18 deletions
26
app/admin.py
26
app/admin.py
|
@ -151,10 +151,10 @@ class RangeCountryInline(admin.TabularInline):
|
||||||
|
|
||||||
class RangeAdmin(admin.ModelAdmin):
|
class RangeAdmin(admin.ModelAdmin):
|
||||||
autocomplete_fields = ['mother_range']
|
autocomplete_fields = ['mother_range']
|
||||||
inlines = [
|
# inlines = [
|
||||||
RangeNameTranslationInline,
|
# RangeNameTranslationInline,
|
||||||
RangeCountryInline
|
# RangeCountryInline
|
||||||
]
|
# ]
|
||||||
readonly_fields = ('id', 'gmba_v2_id')
|
readonly_fields = ('id', 'gmba_v2_id')
|
||||||
search_fields = ['name', 'range_name', 'range_name_ascii',
|
search_fields = ['name', 'range_name', 'range_name_ascii',
|
||||||
'level', 'level', 'level_1', 'level_2', 'level_3', 'peak_name', 'comments', 'source',
|
'level', 'level', 'level_1', 'level_2', 'level_3', 'peak_name', 'comments', 'source',
|
||||||
|
@ -162,12 +162,11 @@ class RangeAdmin(admin.ModelAdmin):
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(None, {
|
(None, {
|
||||||
'fields': (
|
'fields': (
|
||||||
('gmba_v2_id', 'range_name', 'range_name_language', 'map_unit'),
|
('gmba_v2_id', 'range_name', 'range_name_language'),
|
||||||
('range_name_map', 'select_300', 'checked'),
|
('map_unit', 'feature', 'gmba_narrow', 'select_300'),
|
||||||
('range_name_ascii', 'GMBA_v1_id'),
|
('range_name_map', 'range_name_ascii', 'GMBA_v1_id'),
|
||||||
('latitude', 'longitude'),
|
('latitude', 'longitude', 'area'),
|
||||||
('mother_range', 'wiki_data_id', 'area'),
|
('mother_range', 'countries', 'wiki_data_id', 'wiki_data_url'),
|
||||||
('feature', 'range_alternate_id', 'gmba_narrow'),
|
|
||||||
'source',
|
'source',
|
||||||
'id',
|
'id',
|
||||||
)
|
)
|
||||||
|
@ -179,13 +178,12 @@ class RangeAdmin(admin.ModelAdmin):
|
||||||
('name_ru', 'name_tr', 'name_cn')
|
('name_ru', 'name_tr', 'name_cn')
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
('Range Countries', {
|
|
||||||
'classes': ('collapse',),
|
|
||||||
'fields': ('countries',),
|
|
||||||
}),
|
|
||||||
('Comments', {
|
('Comments', {
|
||||||
'classes': ('collapse',),
|
'classes': ('collapse',),
|
||||||
'fields': ('comments',),
|
'fields': ('comments',),
|
||||||
|
}),
|
||||||
|
('Others', {
|
||||||
|
'fields': ('range_alternate_id', )
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
list_display = ['range_name', 'mother_range', 'countries']
|
list_display = ['range_name', 'mother_range', 'countries']
|
||||||
|
|
|
@ -452,6 +452,12 @@ def handle_object_dict(object_dict, model_name, debug=False):
|
||||||
for i in ['checked']:
|
for i in ['checked']:
|
||||||
if i in object_dict:
|
if i in object_dict:
|
||||||
object_dict[i] = True if object_dict[i].lower().strip() == 'true' else False
|
object_dict[i] = True if object_dict[i].lower().strip() == 'true' else False
|
||||||
|
for i in ['select_300']:
|
||||||
|
if i in object_dict:
|
||||||
|
object_dict[i] = True if object_dict[i].lower().strip() == 'x' else False
|
||||||
|
for i in ['gmba_narrow']:
|
||||||
|
if i in object_dict:
|
||||||
|
object_dict[i] = True if object_dict[i].lower().strip() == 'x' else False
|
||||||
# area field can't be empty
|
# area field can't be empty
|
||||||
if 'area' in object_dict:
|
if 'area' in object_dict:
|
||||||
if object_dict['area'] == '':
|
if object_dict['area'] == '':
|
||||||
|
|
18
app/migrations/0052_alter_mountainrange_select_300.py
Normal file
18
app/migrations/0052_alter_mountainrange_select_300.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 4.0.1 on 2022-01-13 04:08
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0051_auto_20220104_1608'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='mountainrange',
|
||||||
|
name='select_300',
|
||||||
|
field=models.BooleanField(blank=True, max_length=12, null=True),
|
||||||
|
),
|
||||||
|
]
|
18
app/migrations/0053_alter_mountainrange_select_300.py
Normal file
18
app/migrations/0053_alter_mountainrange_select_300.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 4.0.1 on 2022-01-13 04:15
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0052_alter_mountainrange_select_300'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='mountainrange',
|
||||||
|
name='select_300',
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
),
|
||||||
|
]
|
18
app/migrations/0054_alter_mountainrange_gmba_narrow.py
Normal file
18
app/migrations/0054_alter_mountainrange_gmba_narrow.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 4.0.1 on 2022-01-13 04:37
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0053_alter_mountainrange_select_300'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='mountainrange',
|
||||||
|
name='gmba_narrow',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='GMBA Standard'),
|
||||||
|
),
|
||||||
|
]
|
18
app/migrations/0055_alter_mountainrange_wiki_data_url.py
Normal file
18
app/migrations/0055_alter_mountainrange_wiki_data_url.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 4.0.1 on 2022-01-13 04:44
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0054_alter_mountainrange_gmba_narrow'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='mountainrange',
|
||||||
|
name='wiki_data_url',
|
||||||
|
field=models.URLField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
]
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 4.0.1 on 2022-01-13 05:05
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0055_alter_mountainrange_wiki_data_url'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='mountainrange',
|
||||||
|
name='range_alternate_id',
|
||||||
|
field=models.CharField(blank=True, max_length=128, null=True),
|
||||||
|
),
|
||||||
|
]
|
|
@ -113,14 +113,14 @@ class MountainRange(models.Model):
|
||||||
comments = models.TextField(blank=True, null=True)
|
comments = models.TextField(blank=True, null=True)
|
||||||
checked = models.BooleanField(default=False)
|
checked = models.BooleanField(default=False)
|
||||||
source = models.TextField(blank=True, null=True)
|
source = models.TextField(blank=True, null=True)
|
||||||
range_alternate_id = models.TextField(blank=True, null=True)
|
range_alternate_id = models.CharField(blank=True, null=True, max_length=128)
|
||||||
geologic_region = models.TextField(blank=True, null=True)
|
geologic_region = models.TextField(blank=True, null=True)
|
||||||
gmba_v2_id = models.PositiveIntegerField(blank=True, null=True)
|
gmba_v2_id = models.PositiveIntegerField(blank=True, null=True)
|
||||||
gmba_v2_id_str = models.TextField(blank=True, null=True)
|
gmba_v2_id_str = models.TextField(blank=True, null=True)
|
||||||
wiki_data_id = models.CharField(blank=True, null=True, max_length=25)
|
wiki_data_id = models.CharField(blank=True, null=True, max_length=25)
|
||||||
wiki_data_url = models.TextField(blank=True, null=True)
|
wiki_data_url = models.URLField(blank=True, null=True)
|
||||||
select_300 = models.CharField(blank=True, null=True, max_length=12)
|
select_300 = models.BooleanField(default=False)
|
||||||
gmba_narrow = models.CharField(blank=True, null=True, max_length=12)
|
gmba_narrow = models.BooleanField(default=False, verbose_name="GMBA Standard")
|
||||||
name_fr = models.CharField(blank=True, null=True, max_length=128)
|
name_fr = models.CharField(blank=True, null=True, max_length=128)
|
||||||
name_de = models.CharField(blank=True, null=True, max_length=128)
|
name_de = models.CharField(blank=True, null=True, max_length=128)
|
||||||
name_es = models.CharField(blank=True, null=True, max_length=128)
|
name_es = models.CharField(blank=True, null=True, max_length=128)
|
||||||
|
|
Loading…
Reference in a new issue