-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update locations 1 #5775
Update locations 1 #5775
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5775 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 446 448 +2
Lines 25133 25165 +32
=========================================
+ Hits 25133 25165 +32 ☔ View full report in Codecov by Sentry. |
27384fa
to
c735b2b
Compare
temba/locations/models.py
Outdated
geometries = GeometryManager() | ||
|
||
class Meta: | ||
indexes = [models.Index(Upper("name"), name="locations_by_name")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we keep it, let's switch to Lower("name") instead as most other models use lower instead of upper.
temba/locations/models.py
Outdated
level = models.IntegerField() | ||
parent = TreeForeignKey("self", null=True, on_delete=models.PROTECT, related_name="children", db_index=True) | ||
path = models.CharField(max_length=768) # e.g. Rwanda > Kigali | ||
simplified_geometry = models.JSONField(null=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we used to store two types of geometry? One simplified and one not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so as that is how the extraction is done with posm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or that was just to match the simplified_geometry field we get from the extraction
temba/locations/models.py
Outdated
name = models.CharField(max_length=Location.MAX_NAME_LEN, help_text="The name for our alias") | ||
|
||
class Meta: | ||
indexes = [models.Index(Upper("name"), name="locationaliases_by_name")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
temba/locations/models.py
Outdated
simplified_geometry = models.JSONField(null=True) | ||
|
||
objects = NoGeometryManager() | ||
geometries = GeometryManager() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't feel worth having
c735b2b
to
7940785
Compare
e0d8038
to
e54497c
Compare
No description provided.