Skip to content

Commit

Permalink
57 rework detail views (#59)
Browse files Browse the repository at this point in the history
* minor [skip ci]

* replaced broken error handler in leaflaet js-function [skip ci]

* new detail view for shapes
* also replaced some `.format()` with `f-strings`
  • Loading branch information
csae8092 authored Jul 12, 2024
1 parent a460ae6 commit f3a1b72
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 354 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-buster
FROM python:3.11-buster

# install nginx posgtes and gdal
RUN apt-get update -y && apt-get upgrade -y && apt-get install nginx vim \
Expand Down
151 changes: 0 additions & 151 deletions import shapefiles 8-6-2018.ipynb

This file was deleted.

8 changes: 4 additions & 4 deletions shps/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,22 +393,22 @@ def sq_km(self, ct=3035):
return sq_km

def slug_name(self):
return "{}__{}_{}".format(slugify(self.name), self.start_date, self.end_date)
return f"{slugify(self.name)}__{self.start_date}_{self.end_date}"

def sanitize_wikidataid(self):
if self.wikidata_id is not None:
if self.wikidata_id.startswith("http"):
return self.wikidata_id
else:
return "https://www.wikidata.org/wiki/{}".format(self.wikidata_id)
return f"https://www.wikidata.org/wiki/{self.wikidata_id}"
else:
return None

def __str__(self):
if self.name:
return "{} ({} - {})".format(self.name, self.start_date, self.end_date)
return f"{self.name} ({self.start_date}{self.end_date})"
else:
return "TempStatial ID: {}".format(self.id)
return f"TempStatial ID: {self.id}"


class TempStatialRel(IdProvider):
Expand Down
Loading

0 comments on commit f3a1b72

Please sign in to comment.