Quellcode durchsuchen

[index] [minor] add indexes

version-14
Rushabh Mehta vor 11 Jahren
Ursprung
Commit
f4299f097b
6 geänderte Dateien mit 26 neuen und 5 gelöschten Zeilen
  1. +1
    -1
      conf/Framework.sql
  2. +7
    -0
      core/doctype/comment/comment.py
  3. +8
    -1
      core/doctype/defaultvalue/defaultvalue.py
  4. +1
    -1
      core/doctype/defaultvalue/defaultvalue.txt
  5. +4
    -0
      public/js/wn/form/infobar.js
  6. +5
    -2
      webnotes/utils/__init__.py

+ 1
- 1
conf/Framework.sql Datei anzeigen

@@ -200,7 +200,7 @@ CREATE TABLE `tabSingles` (
`doctype` varchar(40) DEFAULT NULL,
`field` varchar(40) DEFAULT NULL,
`value` text,
KEY `doctype` (`doctype`)
KEY `singles_doctype_field_index` (`doctype`, `field`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--


+ 7
- 0
core/doctype/comment/comment.py Datei anzeigen

@@ -20,3 +20,10 @@ class DocType:
startup.event_handlers.comment_added(self.doc)
except ImportError, e:
pass

def on_doctype_update():
if not webnotes.conn.sql("""show index from `tabComment`
where Key_name="comment_doctype_docname_index" """):
webnotes.conn.commit()
webnotes.conn.sql("""alter table `tabComment`
add index comment_doctype_docname_index(comment_doctype, comment_docname)""")

+ 8
- 1
core/doctype/defaultvalue/defaultvalue.py Datei anzeigen

@@ -6,4 +6,11 @@ import webnotes

class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
self.doc, self.doclist = d, dl
def on_doctype_update():
if not webnotes.conn.sql("""show index from `tabDefaultValue`
where Key_name="defaultvalue_parent_defkey_index" """):
webnotes.conn.commit()
webnotes.conn.sql("""alter table `tabDefaultValue`
add index defaultvalue_parent_defkey_index(parent, defkey)""")

+ 1
- 1
core/doctype/defaultvalue/defaultvalue.txt Datei anzeigen

@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:32",
"docstatus": 0,
"modified": "2013-07-10 14:54:07",
"modified": "2013-11-15 10:16:30",
"modified_by": "Administrator",
"owner": "Administrator"
},


+ 4
- 0
public/js/wn/form/infobar.js Datei anzeigen

@@ -11,6 +11,10 @@ wn.ui.form.InfoBar = Class.extend({
var me = this;

this.appframe.iconbar.clear(2);
this.$reload = this.appframe.add_icon_btn("2", "icon-refresh", "Reload Page",
function() { me.frm.reload_doc(); })


this.$timestamp = this.appframe.add_icon_btn("2", "icon-user", "Creation / Modified By",
function() { })



+ 5
- 2
webnotes/utils/__init__.py Datei anzeigen

@@ -188,9 +188,12 @@ def get_user_time_zone():
return webnotes.local.user_time_zone

def convert_utc_to_user_timezone(utc_timestamp):
from pytz import timezone
from pytz import timezone, UnknownTimeZoneError
utcnow = timezone('UTC').localize(utc_timestamp)
return utcnow.astimezone(timezone(get_user_time_zone()))
try:
return utcnow.astimezone(timezone(get_user_time_zone()))
except UnknownTimeZoneError:
return utcnow

def now():
"""return current datetime as yyyy-mm-dd hh:mm:ss"""


Laden…
Abbrechen
Speichern