-
Notifications
You must be signed in to change notification settings - Fork 76
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
💫 feat: change infrastructure condition field to ManyToMany field (#3970) #4084
Conversation
b720719
to
079ab62
Compare
079ab62
to
cdb732e
Compare
23530e8
to
1e6dfd9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4084 +/- ##
==========================================
- Coverage 98.38% 95.90% -2.48%
==========================================
Files 267 267
Lines 20810 20819 +9
==========================================
- Hits 20473 19966 -507
- Misses 337 853 +516 ☔ View full report in Codecov by Sentry. |
Passing run #9592 ↗︎
Details:
Review all test suite changes for PR #4084 ↗︎ |
1e6dfd9
to
2abc522
Compare
{% else %} | ||
<span>{{ condition.label }}<span> | ||
{% endif %} | ||
{% endfor %} |
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.
Why don't you use {{ object.conditions_display }} ?
if extracted: | ||
obj.conditions.set(extracted) | ||
else: | ||
obj.conditions.add(InfrastructureConditionFactory.create()) |
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.
can you factorize post_generation in an InfrastructureFatoyMixin ?
@@ -21,7 +21,9 @@ CREATE VIEW {{ schema_geotrek }}.v_infrastructures AS WITH v_infra AS | |||
{% endfor %} | |||
CONCAT (e.min_elevation, 'm') AS altitude, | |||
t.implantation_year, | |||
t.condition_id, | |||
{% for conditon in t.conditions %} | |||
conditon_id, |
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 don't understand why you add each id in a dedicated column
|
||
# Copy InfrastructureCondition to SignageCondition and BladeCondition | ||
for infrastructure in Infrastructure.objects.all(): | ||
infrastructure.conditions.add(infrastructure.condition) |
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.
Fails if we have an infrastructure with no Condition
d262e54
to
cc3bf46
Compare
59bd5c9
to
6059086
Compare
geotrek/infrastructure/models.py
Outdated
conditions = models.ManyToManyField( | ||
InfrastructureCondition, | ||
related_name='infrastructures', | ||
verbose_name=_("Condition"), |
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.
verbose_name=_("Condition"), | |
verbose_name=_("Conditions"), |
7a7e7f5
to
164072f
Compare
@@ -5,6 +5,9 @@ CHANGELOG | |||
2.108.0+dev (XXXX-XX-XX) | |||
---------------------------- | |||
|
|||
**Improvements** | |||
|
|||
- Change infrastructure condition field to ManyToMany field (#3970) |
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.
- Change infrastructure condition field to ManyToMany field (#3970) | |
- Change infrastructure condition field to ManyToMany field (#3970) | |
docs/changelog.rst
Outdated
@@ -78,6 +81,7 @@ https://geotrek.readthedocs.io/en/latest/install/upgrade.html#postgresql | |||
- Bump mapentity to 8.9.0 | |||
|
|||
|
|||
|
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.
docs/changelog.rst
Outdated
@@ -129,7 +133,6 @@ https://geotrek.readthedocs.io/en/latest/install/upgrade.html#postgresql | |||
- Add structures to Aggregator (#3569) | |||
- Allow to filter flatpages by portal on admin list page | |||
|
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.
6b7b37d
to
a60e224
Compare
a60e224
to
1197850
Compare
Description
Related Issue
Checklist