forked from expo/troggle
Added editing of flat pages. Added slugfields to models to refer to them.
This commit is contained in:
@@ -103,7 +103,16 @@ def LoadCaveTab():
|
||||
addToDefaultArgs(Extent, "extent")
|
||||
addToDefaultArgs(SurvexFile, "survex_file")
|
||||
addToDefaultArgs(Notes, "notes")
|
||||
|
||||
if line[Area] == "1626":
|
||||
if line[KatasterNumber] != "":
|
||||
args["slug"] = line[Area] + "-" + line[KatasterNumber]
|
||||
else:
|
||||
args["slug"] = line[Area] + "-" + line[UnofficialNumber]
|
||||
else:
|
||||
if line[KatasterNumber] != "":
|
||||
args["slug"] = "1623" + "-" + line[KatasterNumber]
|
||||
else:
|
||||
args["slug"] = "1623" + "-" + line[UnofficialNumber]
|
||||
#The following adds the legacy_file_path. This is always in either Autogen file or Link file
|
||||
for header in (AutogenFile,LinkFile):
|
||||
if line[header]:
|
||||
@@ -148,6 +157,12 @@ def LoadCaveTab():
|
||||
line[MultipleEntrances] == 'entrance' or \
|
||||
line[MultipleEntrances] == 'last entrance':
|
||||
args = {}
|
||||
|
||||
if line[Entrances]:
|
||||
entrance_letter = line[Entrances]
|
||||
else:
|
||||
entrance_letter = ''
|
||||
|
||||
def addToArgs(CSVname, modelName):
|
||||
if line[CSVname]:
|
||||
args[modelName] = html_to_wiki(line[CSVname])
|
||||
@@ -201,15 +216,12 @@ def LoadCaveTab():
|
||||
addToArgsSurveyStation(GPSpostSA, 'other_station')
|
||||
args['other_description'] = 'post selective availability GPS'
|
||||
addToArgs(Bearings, 'bearings')
|
||||
args['slug'] = newCave.slug + entrance_letter
|
||||
newEntrance = models.Entrance(**args)
|
||||
newEntrance.save()
|
||||
|
||||
logging.info("Added entrance "+str(newEntrance)+"\n")
|
||||
|
||||
if line[Entrances]:
|
||||
entrance_letter = line[Entrances]
|
||||
else:
|
||||
entrance_letter = ''
|
||||
|
||||
|
||||
newCaveAndEntrance = models.CaveAndEntrance(cave = newCave, entrance = newEntrance, entrance_letter = entrance_letter)
|
||||
newCaveAndEntrance.save()
|
||||
|
||||
Reference in New Issue
Block a user