Use a materialized Extension.latest_version field instead of a dynamic property #152
No reviewers
Labels
No Label
Priority
Critical
Priority
High
Priority
Low
Priority
Normal
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Type
Breaking
Type
Documentation
Type
Enhancement
Type
Feature
Type
Report
Type
Security
Type
Suggestion
Type
Testing
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/extensions-website#152
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "latest-version-field"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original reason for this change is #128: we need an efficient way to query tags of a latest_version.
We could potentially avoid converting this property to a field if we had a proper search engine, but we would still need to define the same explicit triggers for reindexing - i.e. recompute the latest_version change.
This PR also takes a stab at simplifying data flow, but more work is needed to improve the management of
is_listed
andstatus
fields.@ -0,0 +29,4 @@
latest_version = version
break
extension.latest_version = latest_version
extension.save(update_fields={'latest_version'})
Extension.objects.bulk_update(.., fields={'latest_version'})
@ -415,1 +409,4 @@
@transaction.atomic
def update_latest_version(self, skip_version=None):
versions = self.versions.all().order_by('-date_created')
select_related
missing for.file
@ -416,0 +429,4 @@
and self.versions.filter(file__status=File.STATUSES.APPROVED).count() > 0
)
# this method is called from post_save signal, this early return above should prevent a loop
"below"?
@ -222,3 +222,3 @@
_get_all_form_errors(response),
)
self.assertFalse("TODO: It should also list previews as required")
# self.assertFalse("TODO: It should also list previews as required")
should a separate commit, out of scope