Browse Source

Delete documents

pull/3111/head
Ruud 11 years ago
parent
commit
a6be59bbea
  1. 4
      couchpotato/core/database.py
  2. 7
      couchpotato/templates/database.html

4
couchpotato/core/database.py

@ -60,7 +60,9 @@ class Database(object):
db = self.getDB()
try:
document = db.get(id)
document_id = kwargs.get('_request').get_argument('id')
document = db.get('id', document_id)
db.delete(document)
return {

7
couchpotato/templates/database.html

@ -55,12 +55,15 @@
(e).stop();
if(confirm('Are you sure?')){
var a = this;
new Request.JSON({
'url': api_base + 'database.document.delete',
'data': this.get('data-id'),
'data': {
'id': a.get('data-id')
},
'onSuccess': function(){
console.log(arguments);
a.getParent('tr').destroy();
}
}).send();
}

Loading…
Cancel
Save