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() db = self.getDB()
try: try:
document = db.get(id)
document_id = kwargs.get('_request').get_argument('id')
document = db.get('id', document_id)
db.delete(document) db.delete(document)
return { return {

7
couchpotato/templates/database.html

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

Loading…
Cancel
Save