Skip to content
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

Set default order of PublishedProject to (title, version_order) and ActiveProject to (title, creation_datetime). Fixes #2132 #2133

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by Django 4.1.10 on 2023-11-20 20:17

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("project", "0070_unpublishedproject_version_order_2"),
]

operations = [
migrations.AlterModelOptions(
name="activeproject",
options={
"default_permissions": ("change",),
"ordering": ("title", "creation_datetime"),
"permissions": [
("can_assign_editor", "Can assign editor"),
("can_edit_activeprojects", "Can edit ActiveProjects"),
],
},
),
migrations.AlterModelOptions(
name="publishedproject",
options={
"default_permissions": ("change",),
"ordering": ("title", "version_order"),
"permissions": [
("can_edit_featured_content", "Can edit featured content"),
("can_view_access_logs", "Can view access logs"),
("can_view_project_guidelines", "Can view project guidelines"),
("can_view_stats", "Can view stats"),
],
},
),
]
1 change: 1 addition & 0 deletions physionet-django/project/modelcomponents/activeproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class Meta:
('can_assign_editor', 'Can assign editor'),
('can_edit_activeprojects', 'Can edit ActiveProjects')
]
ordering = ('title', 'creation_datetime')

def storage_used(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Meta:
('can_view_project_guidelines', 'Can view project guidelines'),
('can_view_stats', 'Can view stats')
]
ordering = ('title', 'version_order')

def __str__(self):
return ('{0} v{1}'.format(self.title, self.version))
Expand Down
Loading