Merge pull request #2873 from zarfide/permalinkOptimization_jzarfoss
used fixedName variable to transport db lookup optimization
This commit is contained in:
commit
805d6942ae
|
@ -393,6 +393,9 @@ def render(args):
|
|||
Certificate.cn.ilike(term),
|
||||
)
|
||||
)
|
||||
elif "fixedName" in terms:
|
||||
# only what matches the fixed name directly if a fixedname is provided
|
||||
query = query.filter(Certificate.name == terms[1])
|
||||
else:
|
||||
query = database.filter(query, Certificate, terms)
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ angular.module('lemur')
|
|||
controller: 'CertificatesViewController'
|
||||
})
|
||||
.state('certificate', {
|
||||
url: '/certificates/:name',
|
||||
url: '/certificates/:fixedName', // use "fixedName" if in URL to indicate 'like' query can be avoided
|
||||
templateUrl: '/angular/certificates/view/view.tpl.html',
|
||||
controller: 'CertificatesViewController'
|
||||
});
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
</td>
|
||||
<td data-title="''" style="text-align: center; vertical-align: middle;">
|
||||
<div class="btn-group pull-right" role="group" aria-label="...">
|
||||
<a class="btn btn-sm btn-primary" ui-sref="certificate({name: certificate.name})">Permalink</a>
|
||||
<a class="btn btn-sm btn-primary" ui-sref="certificate({fixedName: certificate.name})">Permalink</a>
|
||||
<button ng-model="certificate.toggle" class="btn btn-sm btn-info" uib-btn-checkbox btn-checkbox-true="1"
|
||||
btn-checkbox-false="0">More
|
||||
</button>
|
||||
|
|
Loading…
Reference in New Issue