Exemple #1
0
def archive_items():
    il = eval(webnotes.form_dict.get('items'))

    from webnotes.utils.archive import archive_doc
    for d in il:
        archive_doc(d[0], d[1],
                    webnotes.form_dict.get('action') == 'Restore' and 1 or 0)
Exemple #2
0
def archive_items():
    il = eval(webnotes.form_dict.get("items"))

    from webnotes.utils.archive import archive_doc

    for d in il:
        archive_doc(d[0], d[1], webnotes.form_dict.get("action") == "Restore" and 1 or 0)
Exemple #3
0
def execute():
    """
		* Restore archived data from arc tables
		* Drop arc tables
	"""
    import webnotes
    from webnotes.utils import archive
    arc_tables = webnotes.conn.sql('show tables like "arc%"')
    try:
        webnotes.conn.auto_commit_on_many_writes = 1
        for tab in arc_tables:
            tab = tab[0]
            dt = tab[3:]
            res = webnotes.conn.sql("SELECT name FROM `%s`" % tab)
            for dn in res:
                archive.archive_doc(dt, dn[0], restore=1)
    except Exception, e:
        raise e
Exemple #4
0
def execute():
	"""
		* Restore archived data from arc tables
		* Drop arc tables
	"""
	import webnotes
	from webnotes.utils import archive
	arc_tables = webnotes.conn.sql('show tables like "arc%"')
	try:
		webnotes.conn.auto_commit_on_many_writes = 1
		for tab in arc_tables:
			tab = tab[0]
			dt = tab[3:]
			res = webnotes.conn.sql("SELECT name FROM `%s`" % tab)
			for dn in res:
				archive.archive_doc(dt, dn[0], restore=1)
	except Exception, e:
		raise e
	def archive_items(self,arg):
		arg = eval(arg)
		
		from webnotes.utils.archive import archive_doc
		for d in arg['items']:
			archive_doc(d[0], d[1], arg['action']=='Restore' and 1 or 0)
Exemple #6
0
def archive_items():
	il = eval(webnotes.form_dict.get('items'))
	
	from webnotes.utils.archive import archive_doc
	for d in il:
		archive_doc(d[0], d[1], webnotes.form_dict.get('action')=='Restore' and 1 or 0)
Exemple #7
0
    def archive_items(self, arg):
        arg = eval(arg)

        from webnotes.utils.archive import archive_doc
        for d in arg['items']:
            archive_doc(d[0], d[1], arg['action'] == 'Restore' and 1 or 0)