Extensions list: sort_by parameter #159

Merged
Márton Lente merged 36 commits from filter-sort into main 2024-06-03 12:57:45 +02:00
2 changed files with 0 additions and 34 deletions
Showing only changes of commit f55744bceb - Show all commits

View File

@ -1,29 +0,0 @@
# Generated by Django 4.2.11 on 2024-05-31 09:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('extensions', '0031_extension_latest_version'),
]
operations = [
migrations.AlterModelOptions(
name='extension',
options={},
),
migrations.AddIndex(
model_name='extension',
index=models.Index(fields=['average_score'], name='extensions__average_c33b2b_idx'),
),
migrations.AddIndex(
model_name='extension',
index=models.Index(fields=['date_approved'], name='extensions__date_ap_b18acd_idx'),
),
migrations.AddIndex(
model_name='extension',
index=models.Index(fields=['download_count'], name='extensions__downloa_516939_idx'),
),
]

View File

@ -220,11 +220,6 @@ class Extension(CreatedModifiedMixin, RatingMixin, TrackChangesMixin, models.Mod
objects = ExtensionManager() objects = ExtensionManager()
class Meta: class Meta:
indexes = [
models.Index(fields=['average_score']),
models.Index(fields=['date_approved']),
models.Index(fields=['download_count']),
]
ordering = ['-average_score', '-date_created', 'name'] ordering = ['-average_score', '-date_created', 'name']
def __str__(self): def __str__(self):