DB repopulated

parent a791cd9b
No preview for this file type
...@@ -17,7 +17,7 @@ class Command(BaseCommand): ...@@ -17,7 +17,7 @@ class Command(BaseCommand):
print ("Index: ", index) print ("Index: ", index)
for feat in data['features']: for feat in data['features']:
polygon = Polygon( polygon = Polygon(
name = feat['properties']['NOMGEO'], name = self.strip_accents(feat['properties']['NOMGEO'].lower()),
json_info = json.dumps(feat, ensure_ascii=True) json_info = json.dumps(feat, ensure_ascii=True)
) )
...@@ -32,3 +32,6 @@ class Command(BaseCommand): ...@@ -32,3 +32,6 @@ class Command(BaseCommand):
# print ("CVEGEO: ", feature['properties']['CVEGEO']) # print ("CVEGEO: ", feature['properties']['CVEGEO'])
# print ("coordinates: ", feature['geometry']['coordinates']) # print ("coordinates: ", feature['geometry']['coordinates'])
# print ("_____________________________________________") # 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