[files] [cleanup/redesign] removed the old file_list structure and also added file listing in setup

This commit is contained in:
Rushabh Mehta
2013-04-10 13:54:13 +05:30
parent 33075e1f69
commit 0c1611219e
6 changed files with 41 additions and 15 deletions

View File

@@ -0,0 +1,11 @@
import webnotes, os, webnotes.utils
def execute():
files_path = webnotes.utils.get_path("public", "files")
for f in webnotes.conn.sql("""select name, file_name from
`tabFile Data`""", as_dict=True):
filepath = os.path.join(files_path, f.file_name)
if os.path.exists(filepath):
webnotes.conn.set_value("File Data", f.name, "file_size", os.stat(filepath).st_size)