DB repopulated

parent a791cd9b
No preview for this file type
......@@ -17,7 +17,7 @@ class Command(BaseCommand):
print ("Index: ", index)
for feat in data['features']:
polygon = Polygon(
name = feat['properties']['NOMGEO'],
name = self.strip_accents(feat['properties']['NOMGEO'].lower()),
json_info = json.dumps(feat, ensure_ascii=True)
)
......@@ -31,4 +31,7 @@ class Command(BaseCommand):
# print ("CVE_MUN: ", feature['properties']['CVE_MUN'])
# print ("CVEGEO: ", feature['properties']['CVEGEO'])
# print ("coordinates: ", feature['geometry']['coordinates'])
# print ("_____________________________________________")
\ No newline at end of file
# print ("_____________________________________________")
def strip_accents(self, s):
return ''.join((c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn'))
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment