Browse Source

Merge branch 'master' of git://github.com/webnotes/wnframework

version-14
Anand Doshi 14 years ago
parent
commit
baa9be2c16
3 changed files with 11 additions and 3 deletions
  1. +1
    -0
      README
  2. +2
    -1
      cgi-bin/webnotes/db.py
  3. +8
    -2
      cgi-bin/webnotes/model/__init__.py

+ 1
- 0
README View File

@@ -0,0 +1 @@
Web Notes Framework: A web application framework with client-side and server-side libraries including metadata definition, forms, virtual pages- Ideal for developing js driven database apps.

+ 2
- 1
cgi-bin/webnotes/db.py View File

@@ -246,8 +246,9 @@ class Database:
return r and (len(r) > 1 and (i[0] for i in r) or r[0][0]) or None

def set_value(self, dt, dn, field, val):
from webnotes.utils import now
if dn and dt!=dn:
self.sql("update `tab"+dt+"` set `"+field+"`=%s where name=%s", (val, dn))
self.sql("update `tab"+dt+"` set `"+field+"`=%s, modified=%s where name=%s", (val, dn, now()))
else:
if self.sql("select value from tabSingles where field=%s and doctype=%s", (field, dt)):
self.sql("update tabSingles set value=%s where field=%s and doctype=%s", (val, field, dt))


+ 8
- 2
cgi-bin/webnotes/model/__init__.py View File

@@ -38,11 +38,17 @@ def delete_doc(doctype=None, name=None, doclist = None):
import webnotes.model.meta
sql = webnotes.conn.sql

# get from form
if not doctype:
doctype = webnotes.form_dict.get('dt')
name = webnotes.form_dict.get('dn')
if not doctype:
webnotes.msgprint('Nothing to delete!', raise_exception =1)
if not doctype:
webnotes.msgprint('Nothing to delete!', raise_exception =1)

# already deleted..?
if not webnotes.conn.exists(doctype, name):
return

tablefields = webnotes.model.meta.get_table_fields(doctype)


Loading…
Cancel
Save