only return instances if requested

This commit is contained in:
j 2012-01-19 17:27:47 +05:30
parent 2180021421
commit ff3f1c3399
3 changed files with 2 additions and 5 deletions

View file

@ -207,9 +207,6 @@ class File(models.Model):
return False return False
def json(self, keys=None, user=None): def json(self, keys=None, user=None):
#FIXME: why?
if keys and not 'instances' in keys:
keys.append('instances')
resolution = (self.width, self.height) resolution = (self.width, self.height)
if resolution == (0, 0): if resolution == (0, 0):
resolution = None resolution = None

View file

@ -183,7 +183,7 @@ pandora.ui.filesView = function(options, self) {
} }
}), callback); }), callback);
}, },
keys: ['wanted'], keys: ['wanted', 'instances'],
scrollbarVisible: true, scrollbarVisible: true,
sort: [{key: 'path', operator: '+'}] sort: [{key: 'path', operator: '+'}]
}) })

View file

@ -167,8 +167,8 @@ pandora.ui.infoView = function(data) {
.append( .append(
Ox.Editable({ Ox.Editable({
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
placeholder: formatLight('unknown'),
editable: isEditable, editable: isEditable,
placeholder: formatLight('unknown'),
tooltip: isEditable ? 'Doubleclick to edit' : '', tooltip: isEditable ? 'Doubleclick to edit' : '',
type: 'textarea', type: 'textarea',
value: data.description || '' value: data.description || ''