Make range similar to access
This commit is contained in:
parent
2e6e4a6842
commit
cf20ba24df
2 changed files with 40 additions and 12 deletions
28
app/admin.py
28
app/admin.py
|
@ -52,6 +52,34 @@ class RangeAdmin(admin.ModelAdmin):
|
|||
search_fields = ['name', 'range_name', 'range_name_ascii', 'range_name_language', 'mother_range', 'feature',
|
||||
'level', 'level', 'level_1', 'level_2', 'level_3', 'peak_name', 'comments', 'source',
|
||||
'name_fr', 'name_de', 'name_es', 'name_pt', 'name_cn', 'name_ru', 'name_tr']
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields': (
|
||||
('gmba_v2_id', 'range_name', 'range_name_language', 'map_unit'),
|
||||
('range_name_map','select_300', 'latitude', 'checked'),
|
||||
('range_name_ascii', 'gmba_v1_id', 'longitude'),
|
||||
('mother_range', 'wiki_data_id', 'area'),
|
||||
('feature', 'range_alternate_id', 'gmba_narrow'),
|
||||
'countries',
|
||||
'source',
|
||||
('range_id', 'area')
|
||||
)
|
||||
}),
|
||||
('Range Name Translation', {
|
||||
'classes': ('collapse',),
|
||||
'fields': (
|
||||
('name_fr', 'name_de', 'name_es', 'name_pt'),
|
||||
('name_ru', 'name_tr', 'name_cn'),),
|
||||
}),
|
||||
('Range Countries', {
|
||||
'classes': ('collapse',),
|
||||
'fields': ('countries'),
|
||||
}),
|
||||
('Comments', {
|
||||
'classes': ('collapse',),
|
||||
'fields': ('comments'),
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
class FieldAdmin(admin.ModelAdmin):
|
||||
|
|
|
@ -60,6 +60,14 @@ class MethodsPeople(models.Model):
|
|||
db_table = 'methods_people'
|
||||
|
||||
|
||||
class Language(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
language = models.TextField(blank=True, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.language
|
||||
|
||||
|
||||
class Range(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
source_id = models.IntegerField(blank=True, null=True)
|
||||
|
@ -70,9 +78,9 @@ class Range(models.Model):
|
|||
range_name_map = models.TextField(blank=True, null=True, unique=True)
|
||||
range_name = models.TextField(blank=True, null=True)
|
||||
range_name_ascii = models.TextField(blank=True, null=True)
|
||||
range_name_language = models.TextField(blank=True, null=True)
|
||||
mother_range = models.TextField(blank=True, null=True)
|
||||
feature = models.TextField(blank=True, null=True)
|
||||
range_name_language = models.ForeignKey(Language, models.DO_NOTHING, blank=True, null=True, to_field='id')
|
||||
mother_range = models.ForeignKey("self", models.DO_NOTHING, blank=True, null=True, to_field='id')
|
||||
feature = models.TextField(blank=True, null=True) # TODO needs to be a drop down
|
||||
map_unit = models.TextField(blank=True, null=True)
|
||||
level = models.TextField(blank=True, null=True)
|
||||
level_text = models.TextField(blank=True, null=True)
|
||||
|
@ -89,7 +97,7 @@ class Range(models.Model):
|
|||
peak_latitude = models.TextField(blank=True, null=True)
|
||||
peak_longitude = models.TextField(blank=True, null=True)
|
||||
comments = models.TextField(blank=True, null=True)
|
||||
checked = models.TextField(blank=True, null=True)
|
||||
checked = models.BooleanField(default=False)
|
||||
source = models.TextField(blank=True, null=True)
|
||||
range_alternate_id = models.TextField(blank=True, null=True)
|
||||
geologic_region = models.TextField(blank=True, null=True)
|
||||
|
@ -221,14 +229,6 @@ class GMBA_SpeciesGroup(models.Model):
|
|||
return self.species_group
|
||||
|
||||
|
||||
class Language(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
language = models.TextField(blank=True, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.language
|
||||
|
||||
|
||||
class PeopleStatus(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
status = models.TextField(blank=True, null=True)
|
||||
|
|
Loading…
Reference in a new issue