@@ -117,6 +117,15 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile):
def __str__(self):
return self.python_name
+ @property
+ def ordered_scripts(self):
+ script_objects = {s.name: s for s in self.scripts.all()}
+ ordered = [
+ script_objects.pop(sc) for sc in self.module_scripts.keys() if sc in script_objects
+ ]
+ ordered.extend(script_objects.items())
+ return ordered
+
@property
def module_scripts(self):
@@ -37,7 +37,7 @@
{% endif %}
</div>
</h2>
- {% with scripts=module.scripts.all %}
+ {% with scripts=module.ordered_scripts %}
{% if scripts %}
<table class="table table-hover scripts">
<thead>