used fixedName variable to transport db lookup optimization
This commit is contained in:
parent
93aca891b7
commit
00a0a27826
|
@ -393,6 +393,9 @@ def render(args):
|
||||||
Certificate.cn.ilike(term),
|
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:
|
else:
|
||||||
query = database.filter(query, Certificate, terms)
|
query = database.filter(query, Certificate, terms)
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ angular.module('lemur')
|
||||||
controller: 'CertificatesViewController'
|
controller: 'CertificatesViewController'
|
||||||
})
|
})
|
||||||
.state('certificate', {
|
.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',
|
templateUrl: '/angular/certificates/view/view.tpl.html',
|
||||||
controller: 'CertificatesViewController'
|
controller: 'CertificatesViewController'
|
||||||
});
|
});
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td data-title="''" style="text-align: center; vertical-align: middle;">
|
<td data-title="''" style="text-align: center; vertical-align: middle;">
|
||||||
<div class="btn-group pull-right" role="group" aria-label="...">
|
<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"
|
<button ng-model="certificate.toggle" class="btn btn-sm btn-info" uib-btn-checkbox btn-checkbox-true="1"
|
||||||
btn-checkbox-false="0">More
|
btn-checkbox-false="0">More
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in New Issue