Skip to content

Commit

Permalink
Merge pull request mbari-org#245 from MBARIMike/main
Browse files Browse the repository at this point in the history
Fix ordering
  • Loading branch information
MBARIMike authored May 30, 2024
2 parents d359553 + 1af6eda commit ceac654
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion smdb/scripts/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,9 @@ def read_from_db_into_rows(self, parent_dir: str) -> pd.DataFrame:

# Add rows for each mission
rows = []
for mission in Mission.objects.filter(name__startswith=parent_dir):
for mission in Mission.objects.filter(name__startswith=parent_dir).order_by(
"name"
):
self.logger.debug(mission)
row = []
for col in col_lookup.keys():
Expand Down
2 changes: 2 additions & 0 deletions smdb/smdb/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def get_context_data(self, **kwargs):
table = CompilationTable(
Compilation.objects.filter(missions=mission),
exclude=["missions"],
order_by="-creation_date",
)
RequestConfig(self.request).configure(table)
context["table"] = table
Expand Down Expand Up @@ -309,6 +310,7 @@ def get_context_data(self, **kwargs):
table = MissionTable(
Mission.objects.filter(compilations=compilation),
exclude=["track_length", "start_depth"],
order_by="-start_date",
)
RequestConfig(self.request).configure(table)
context["table"] = table
Expand Down

0 comments on commit ceac654

Please sign in to comment.