mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Add consistent script ordering in script search. Resolve #2045
This commit is contained in:
parent
65ec944af0
commit
3084da788f
2 changed files with 8 additions and 6 deletions
|
|
@ -6,7 +6,6 @@ import re
|
|||
from django.conf import settings
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models import Max, Min, Q
|
||||
|
||||
from evennia import InterruptCommand
|
||||
from evennia.commands.cmdhandler import get_and_merge_cmdsets
|
||||
from evennia.locks.lockhandler import LockException
|
||||
|
|
@ -3366,8 +3365,10 @@ class CmdScripts(COMMAND_DEFAULT_CLASS):
|
|||
if scripts:
|
||||
return scripts
|
||||
# try typeclass path
|
||||
scripts = ScriptDB.objects.filter(db_typeclass_path__iendswith=args).exclude(
|
||||
db_typeclass_path__in=self.hide_script_paths
|
||||
scripts = (
|
||||
ScriptDB.objects.filter(db_typeclass_path__iendswith=args)
|
||||
.exclude(db_typeclass_path__in=self.hide_script_paths)
|
||||
.order_by("id")
|
||||
)
|
||||
if scripts:
|
||||
return scripts
|
||||
|
|
@ -3375,8 +3376,10 @@ class CmdScripts(COMMAND_DEFAULT_CLASS):
|
|||
# may be a dbref-range
|
||||
val1, val2 = (dbref(part.strip()) for part in args.split("-", 1))
|
||||
if val1 and val2:
|
||||
scripts = ScriptDB.objects.filter(id__in=(range(val1, val2 + 1))).exclude(
|
||||
db_typeclass_path__in=self.hide_script_paths
|
||||
scripts = (
|
||||
ScriptDB.objects.filter(id__in=(range(val1, val2 + 1)))
|
||||
.exclude(db_typeclass_path__in=self.hide_script_paths)
|
||||
.order_by("id")
|
||||
)
|
||||
if scripts:
|
||||
return scripts
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import shlex
|
|||
|
||||
from django.db.models import Count, ExpressionWrapper, F, FloatField, Q
|
||||
from django.db.models.functions import Cast
|
||||
|
||||
from evennia.typeclasses.attributes import Attribute
|
||||
from evennia.typeclasses.tags import Tag
|
||||
from evennia.utils import idmapper
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue