def handle(self, *args, **options): latest_modification_time = timezone.now() - timedelta(days=30) date_to = latest_modification_time.date().isoformat() for uid in self.get_uids(date_to): o = CouchbaseModel(uid) # print 'will delete %s / %s' % (uid, o.rev) SyncGateway.delete_document(uid, o.rev)
def clean_buckets(): if "test" not in settings.COUCHBASE_BUCKET: raise Exception("will not clean non-test bucket") all_docs = SyncGateway.all_docs([], really_all=True) for i in all_docs["rows"]: uid = i["id"] rev = i["value"]["rev"] if "sync" in uid: continue # print 'del %s' % uid SyncGateway.delete_document(uid, rev)
def clean_buckets(): if 'test' not in settings.COUCHBASE_BUCKET: raise Exception('will not clean non-test bucket') all_docs = SyncGateway.all_docs([], really_all=True) for i in all_docs['rows']: uid = i['id'] rev = i['value']['rev'] if 'sync' in uid: continue # print 'del %s' % uid SyncGateway.delete_document(uid, rev)