Skip to content

Commit

Permalink
Accelerate HOF
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenswat committed Feb 7, 2024
1 parent d57f4e7 commit 382004e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.1.13 on 2024-02-07 15:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
(
"abyssal_modules",
"0020_alter_module_attributes_alter_moduletype_attributes_and_more",
),
]

operations = [
migrations.AddIndex(
model_name="moduleattribute",
index=models.Index(models.F("module__type_id"), name="module_type_id_idx"),
),
]
3 changes: 3 additions & 0 deletions backend/abyssal_modules/models/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class ModuleAttribute(models.Model):

value = models.FloatField(db_index=True)

class Meta:
indexes = [models.Index(F("module__type_id"), name="module_type_id_idx")]


class TypeAttribute(models.Model):
type = models.ForeignKey("ModuleType", models.CASCADE)
Expand Down
4 changes: 0 additions & 4 deletions backend/abyssal_modules/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ def get(self, request, type_id):
except ModuleType.DoesNotExist:
raise Http404("Module type does not exist.")

mutators = Mutator.objects.filter(result=module_type).order_by(
"item_type__name"
)
modules = StaticModule.objects.filter(type=module_type)
attributes = TypeAttribute.objects.filter(
mutatorattribute__mutator__result=module_type
).distinct("attribute")
Expand Down

0 comments on commit 382004e

Please sign in to comment.