[country info] [fix] added additional timezones + fixed fresh install

This commit is contained in:
Anand Doshi 2013-05-20 13:43:49 +05:30
parent 573c601bc5
commit bc09ead75e
4 changed files with 2275 additions and 2104 deletions

View file

@ -213,3 +213,31 @@ CREATE TABLE `__Auth` (
`password` VARCHAR(180) NOT NULL,
KEY `user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `tabFile Data`
--
DROP TABLE IF EXISTS `tabFile Data`;
CREATE TABLE `tabFile Data` (
`name` varchar(120) NOT NULL,
`creation` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
`modified_by` varchar(40) DEFAULT NULL,
`owner` varchar(40) DEFAULT NULL,
`docstatus` int(1) DEFAULT '0',
`parent` varchar(120) DEFAULT NULL,
`parentfield` varchar(120) DEFAULT NULL,
`parenttype` varchar(120) DEFAULT NULL,
`idx` int(8) DEFAULT NULL,
`file_name` varchar(180) DEFAULT NULL,
`file_url` varchar(180) DEFAULT NULL,
`module` varchar(180) DEFAULT NULL,
`attached_to_name` varchar(180) DEFAULT NULL,
`file_size` int(11) DEFAULT NULL,
`attached_to_doctype` varchar(180) DEFAULT NULL,
PRIMARY KEY (`name`),
KEY `parent` (`parent`),
KEY `attached_to_name` (`attached_to_name`),
KEY `attached_to_doctype` (`attached_to_doctype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View file

@ -157,4 +157,15 @@ wn.utils = {
return list;
},
unique: function(list) {
var dict = {},
arr = [];
for(var i=0, l=list.length; i < l; i++) {
if(!dict.hasOwnProperty(list[i])) {
dict[list[i]] = null;
arr.push(list[i]);
}
}
return arr;
},
};

File diff suppressed because it is too large Load diff

View file

@ -11,12 +11,19 @@ def get_country_info(country=None):
return data
@webnotes.whitelist()
def get_all():
with open(os.path.join(os.path.dirname(__file__), "country_info.json"), "r") as local_info:
all_data = json.loads(local_info.read())
return all_data
@webnotes.whitelist()
def get_country_timezone_info():
import pytz
return {
"country_info": get_all(),
"all_timezones": pytz.all_timezones
}
def update():
with open(os.path.join(os.path.dirname(__file__), "currency_info.json"), "r") as nformats:
nformats = json.loads(nformats.read())