webnotes.model.doctype (new version)

This commit is contained in:
Rushabh Mehta
2012-11-29 11:49:56 +05:30
parent a5d18706b7
commit d7fe2bfe1b
18 changed files with 15 additions and 842 deletions

View File

@@ -90,8 +90,7 @@ class DocType:
self.doc.set_options = "\n".join(options)
from webnotes.utils.cache import CacheItem
CacheItem(doctype).clear()
webnotes.clear_cache(doctype=doctype)
def check_duplicate(self):
from core.doctype.doctype.doctype import DocType

View File

@@ -20,7 +20,7 @@ import webnotes
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild, getchildren, make_autoname
from webnotes.model.doc import Document, addchild, getchildren
from webnotes.model.wrapper import getlist, copy_doclist
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
from webnotes import session, form, msgprint, errprint
@@ -30,9 +30,6 @@ sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
in_transaction = webnotes.conn.in_transaction
convert_to_lists = webnotes.conn.convert_to_lists
# -----------------------------------------------------------------------------------------
class DocType:
def __init__(self, doc, doclist):
@@ -60,7 +57,7 @@ class DocType:
# -------------------------------------------------------------------
def get_permissions(self,doctype):
import webnotes.model.doctype
doclist = webnotes.model.doctype.get(doctype, form=0)
doclist = webnotes.model.doctype.get(doctype)
ptype = [{
'role': perm.role,
@@ -195,8 +192,7 @@ class DocType:
sql("update tabDocType set modified = %s where name = %s",(now(), parent))
from webnotes.utils.cache import CacheItem
CacheItem(parent).clear()
webnotes.clear_cache(doctype=parent)
msgprint("Permissions Updated")