search / loading
This commit is contained in:
parent
e685fb4ef4
commit
21884b6587
|
@ -87,11 +87,12 @@ class ItfModel(models.Model):
|
|||
search = options['search']
|
||||
if search != '':
|
||||
qset = kls.fts(qset, search)
|
||||
'''
|
||||
|
||||
sort = options['sort']
|
||||
if sort != []:
|
||||
qset = qset.order_by(sort[0]) #FIXME: Do Sort!
|
||||
'''
|
||||
for s in sort:
|
||||
sort = s['operator'] + s['key']
|
||||
qset = qset.order_by(sort)
|
||||
r0 = options['range'][0]
|
||||
r1 = options['range'][1]
|
||||
results = qset[r0:r1]
|
||||
|
|
|
@ -12,6 +12,8 @@ class BestPractice(ItfModel):
|
|||
quick_howto = models.TextField(blank=True)
|
||||
tags = TagField(blank=True, help_text="Enter as many tags as you like, separated by commas.")
|
||||
category = models.ForeignKey("BestPracticeCategory")
|
||||
added = models.DateTimeField(auto_now_add=True, null=True)
|
||||
modified = models.DateTimeField(auto_now=True, null=True)
|
||||
|
||||
fts_fields = ['title', 'story', 'guideline', 'law', 'theatre', 'quick_howto']
|
||||
fk_filters = ['category']
|
||||
|
|
|
@ -722,13 +722,15 @@ Ox.ItfBox = function(options, self) {
|
|||
.appendTo(that)
|
||||
.hide()
|
||||
.bindEvent("submit", function(value) {
|
||||
app.$ui[options.boxId].$loading.start();
|
||||
$list.options("request", function(data, callback) {
|
||||
return app.api.find(getQueryParams(data), callback)
|
||||
app.$ui[options.boxId].$loading.stop();
|
||||
return app.api.find(getQueryParams(data), callback);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
var $buttons = new Ox.Element().appendTo($title).css({'position': 'absolute', 'top': '1px', 'right': '1px'});
|
||||
var $buttons = new Ox.Element().appendTo($title).css({'position': 'absolute', 'top': '1px', 'right': '16px'});
|
||||
|
||||
that.$loading = new Ox.LoadingIcon().appendTo($buttons);
|
||||
var $infoBtn = new Ox.Button({
|
||||
|
@ -841,13 +843,19 @@ Ox.ItfBox = function(options, self) {
|
|||
unique: true
|
||||
}
|
||||
],
|
||||
'sort': [{
|
||||
key: 'title',
|
||||
operator: '-'
|
||||
}]
|
||||
'sort': [
|
||||
{
|
||||
key: 'added',
|
||||
operator: '-'
|
||||
},
|
||||
{
|
||||
key: 'id',
|
||||
operator: '-'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
var $list = new Ox.ItfList(listOptions)
|
||||
var $list = that.$list = new Ox.ItfList(listOptions)
|
||||
.appendTo($listContainer);
|
||||
|
||||
return that;
|
||||
|
|
Loading…
Reference in New Issue
Block a user