
class DAO(object):
	def __init__(self, **kwargs):
		for k, v in kwargs.iteritems():
			setattr(self, k, v)

	def _to_dict(self, name=None):
		attrs = [attr for attr in self.__dict__ if not attr.startswith('_')]
		_to_dict = {}
		for attr in attrs:
			if isinstance(getattr(self, attr), DAO):
				_to_dict[attr] = getattr(self, attr)._to_dict()
			else:
				_to_dict[attr] = getattr(self, attr)
		return _to_dict

class User(DAO):
	pass

class Address(DAO):
	pass

class Card(DAO):
	pass

class Transaction(DAO):
	pass

class Schedule(DAO):
	pass

class Currency(object):
	all = []	

	def __init__(self, code, name):
		self.code = code
		self.name = name
		Currency.all.append(self)
	
	def __str__(self):
		return self.code

Currency.AUD = Currency('AUD', 'Australian Dollar')
Currency.ARS = Currency('ARS', 'Argentine Peso')
Currency.CAD = Currency('CAD', 'Canadian Dollar')
Currency.DKK = Currency('DKK', 'Danish Krone')
Currency.EUR = Currency('EUR', 'Euro')
Currency.HKD = Currency('HKD', 'Hong Kong Dollar')
Currency.MYR = Currency('MYR', 'Malaysian Ringgit')
Currency.NZD = Currency('NZD', 'New Zealand Dollar')
Currency.NOK = Currency('NOK', 'Norweigan Kroner')
Currency.GBP = Currency('GBP', 'Pounds Sterling')
Currency.SGD = Currency('SGD', 'Singapore Dollar')
Currency.ZAR = Currency('ZAR', 'South African Rand')
Currency.LKR = Currency('LKR', 'Sri Lankan Rupee')
Currency.SEK = Currency('SEK', 'Swedish Krona')
Currency.CHF = Currency('CHF', 'Swiss Franc')
Currency.TRY = Currency('TRY', 'Turkish Lira')
Currency.USD = Currency('USD', 'US Dollar')
Currency.all = sorted(Currency.all, key=lambda currency: currency.name)

class Country(object):
	all = []

	def __init__(self, iso_a2, iso_a3, iso_n, name):
		self.iso_a2 = iso_a2
		self.iso_a3 = iso_a3
		self.iso_n = iso_n
		self.name = name
		Country.all.append(self)

	def __str__(self):
		return self.iso_a2

Country.AFG = Country('AF', 'AFG', 4, 'Afghanistan')
Country.ALB = Country('AL', 'ALB', 8, 'Albania')
Country.DZA = Country('DZ', 'DZA', 12, 'Algeria')
Country.AND = Country('AD', 'AND', 20, 'Andorra')
Country.AGO = Country('AO', 'AGO', 24, 'Angola')
Country.ATG = Country('AG', 'ATG', 28, 'Antigua and Barbuda')
Country.ARG = Country('AR', 'ARG', 32, 'Argentina')
Country.ARM = Country('AM', 'ARM', 51, 'Armenia')
Country.AUS = Country('AU', 'AUS', 36, 'Australia')
Country.AUT = Country('AT', 'AUT', 40, 'Austria')
Country.AZE = Country('AZ', 'AZE', 31, 'Azerbaijan')
Country.BHS = Country('BS', 'BHS', 44, 'Bahamas, The')
Country.BHR = Country('BH', 'BHR', 48, 'Bahrain')
Country.BGD = Country('BD', 'BGD', 50, 'Bangladesh')
Country.BRB = Country('BB', 'BRB', 52, 'Barbados')
Country.BLR = Country('BY', 'BLR', 112, 'Belarus')
Country.BEL = Country('BE', 'BEL', 56, 'Belgium')
Country.BLZ = Country('BZ', 'BLZ', 84, 'Belize')
Country.BEN = Country('BJ', 'BEN', 204, 'Benin')
Country.BTN = Country('BT', 'BTN', 64, 'Bhutan')
Country.BOL = Country('BO', 'BOL', 68, 'Bolivia')
Country.BIH = Country('BA', 'BIH', 70, 'Bosnia and Herzegovina')
Country.BWA = Country('BW', 'BWA', 72, 'Botswana')
Country.BRA = Country('BR', 'BRA', 76, 'Brazil')
Country.BRN = Country('BN', 'BRN', 96, 'Brunei')
Country.BGR = Country('BG', 'BGR', 100, 'Bulgaria')
Country.BFA = Country('BF', 'BFA', 854, 'Burkina Faso')
Country.BDI = Country('BI', 'BDI', 108, 'Burundi')
Country.KHM = Country('KH', 'KHM', 116, 'Cambodia')
Country.CMR = Country('CM', 'CMR', 120, 'Cameroon')
Country.CAN = Country('CA', 'CAN', 124, 'Canada')
Country.CPV = Country('CV', 'CPV', 132, 'Cape Verde')
Country.CAF = Country('CF', 'CAF', 140, 'Central African Republic')
Country.TCD = Country('TD', 'TCD', 148, 'Chad')
Country.CHL = Country('CL', 'CHL', 152, 'Chile')
Country.CHN = Country('CN', 'CHN', 156, 'China, People\'s Republic of')
Country.COL = Country('CO', 'COL', 170, 'Colombia')
Country.COM = Country('KM', 'COM', 174, 'Comoros')
Country.COD = Country('CD', 'COD', 180, 'Congo, Democratic Republic of the (Congo - Kinshasa)')
Country.COG = Country('CG', 'COG', 178, 'Congo, Republic of the (Congo - Brazzaville)')
Country.CRI = Country('CR', 'CRI', 188, 'Costa Rica')
Country.CIV = Country('CI', 'CIV', 384, 'Cote d\'Ivoire (Ivory Coast)')
Country.HRV = Country('HR', 'HRV', 191, 'Croatia')
Country.CUB = Country('CU', 'CUB', 192, 'Cuba')
Country.CYP = Country('CY', 'CYP', 196, 'Cyprus')
Country.CZE = Country('CZ', 'CZE', 203, 'Czech Republic')
Country.DNK = Country('DK', 'DNK', 208, 'Denmark')
Country.DJI = Country('DJ', 'DJI', 262, 'Djibouti')
Country.DMA = Country('DM', 'DMA', 212, 'Dominica')
Country.DOM = Country('DO', 'DOM', 214, 'Dominican Republic')
Country.ECU = Country('EC', 'ECU', 218, 'Ecuador')
Country.EGY = Country('EG', 'EGY', 818, 'Egypt')
Country.SLV = Country('SV', 'SLV', 222, 'El Salvador')
Country.GNQ = Country('GQ', 'GNQ', 226, 'Equatorial Guinea')
Country.ERI = Country('ER', 'ERI', 232, 'Eritrea')
Country.EST = Country('EE', 'EST', 233, 'Estonia')
Country.ETH = Country('ET', 'ETH', 231, 'Ethiopia')
Country.FJI = Country('FJ', 'FJI', 242, 'Fiji')
Country.FIN = Country('FI', 'FIN', 246, 'Finland')
Country.FRA = Country('FR', 'FRA', 250, 'France')
Country.GAB = Country('GA', 'GAB', 266, 'Gabon')
Country.GMB = Country('GM', 'GMB', 270, 'Gambia, The')
Country.GEO = Country('GE', 'GEO', 268, 'Georgia')
Country.DEU = Country('DE', 'DEU', 276, 'Germany')
Country.GHA = Country('GH', 'GHA', 288, 'Ghana')
Country.GRC = Country('GR', 'GRC', 300, 'Greece')
Country.GRD = Country('GD', 'GRD', 308, 'Grenada')
Country.GTM = Country('GT', 'GTM', 320, 'Guatemala')
Country.GIN = Country('GN', 'GIN', 324, 'Guinea')
Country.GNB = Country('GW', 'GNB', 624, 'Guinea-Bissau')
Country.GUY = Country('GY', 'GUY', 328, 'Guyana')
Country.HTI = Country('HT', 'HTI', 332, 'Haiti')
Country.HND = Country('HN', 'HND', 340, 'Honduras')
Country.HUN = Country('HU', 'HUN', 348, 'Hungary')
Country.ISL = Country('IS', 'ISL', 352, 'Iceland')
Country.IND = Country('IN', 'IND', 356, 'India')
Country.IDN = Country('ID', 'IDN', 360, 'Indonesia')
Country.IRN = Country('IR', 'IRN', 364, 'Iran')
Country.IRQ = Country('IQ', 'IRQ', 368, 'Iraq')
Country.IRL = Country('IE', 'IRL', 372, 'Ireland')
Country.ISR = Country('IL', 'ISR', 376, 'Israel')
Country.ITA = Country('IT', 'ITA', 380, 'Italy')
Country.JAM = Country('JM', 'JAM', 388, 'Jamaica')
Country.JPN = Country('JP', 'JPN', 392, 'Japan')
Country.JOR = Country('JO', 'JOR', 400, 'Jordan')
Country.KAZ = Country('KZ', 'KAZ', 398, 'Kazakhstan')
Country.KEN = Country('KE', 'KEN', 404, 'Kenya')
Country.KIR = Country('KI', 'KIR', 296, 'Kiribati')
Country.PRK = Country('KP', 'PRK', 408, 'Korea, Democratic People\'s Republic of (North Korea)')
Country.KOR = Country('KR', 'KOR', 410, 'Korea, Republic of  (South Korea)')
Country.KWT = Country('KW', 'KWT', 414, 'Kuwait')
Country.KGZ = Country('KG', 'KGZ', 417, 'Kyrgyzstan')
Country.LAO = Country('LA', 'LAO', 418, 'Laos')
Country.LVA = Country('LV', 'LVA', 428, 'Latvia')
Country.LBN = Country('LB', 'LBN', 422, 'Lebanon')
Country.LSO = Country('LS', 'LSO', 426, 'Lesotho')
Country.LBR = Country('LR', 'LBR', 430, 'Liberia')
Country.LBY = Country('LY', 'LBY', 434, 'Libya')
Country.LIE = Country('LI', 'LIE', 438, 'Liechtenstein')
Country.LTU = Country('LT', 'LTU', 440, 'Lithuania')
Country.LUX = Country('LU', 'LUX', 442, 'Luxembourg')
Country.MKD = Country('MK', 'MKD', 807, 'Macedonia')
Country.MDG = Country('MG', 'MDG', 450, 'Madagascar')
Country.MWI = Country('MW', 'MWI', 454, 'Malawi')
Country.MYS = Country('MY', 'MYS', 458, 'Malaysia')
Country.MDV = Country('MV', 'MDV', 462, 'Maldives')
Country.MLI = Country('ML', 'MLI', 466, 'Mali')
Country.MLT = Country('MT', 'MLT', 470, 'Malta')
Country.MHL = Country('MH', 'MHL', 584, 'Marshall Islands')
Country.MRT = Country('MR', 'MRT', 478, 'Mauritania')
Country.MUS = Country('MU', 'MUS', 480, 'Mauritius')
Country.MEX = Country('MX', 'MEX', 484, 'Mexico')
Country.FSM = Country('FM', 'FSM', 583, 'Micronesia')
Country.MDA = Country('MD', 'MDA', 498, 'Moldova')
Country.MCO = Country('MC', 'MCO', 492, 'Monaco')
Country.MNG = Country('MN', 'MNG', 496, 'Mongolia')
Country.MNE = Country('ME', 'MNE', 499, 'Montenegro')
Country.MAR = Country('MA', 'MAR', 504, 'Morocco')
Country.MOZ = Country('MZ', 'MOZ', 508, 'Mozambique')
Country.MMR = Country('MM', 'MMR', 104, 'Myanmar (Burma)')
Country.NAM = Country('NA', 'NAM', 516, 'Namibia')
Country.NRU = Country('NR', 'NRU', 520, 'Nauru')
Country.NPL = Country('NP', 'NPL', 524, 'Nepal')
Country.NLD = Country('NL', 'NLD', 528, 'Netherlands')
Country.NZL = Country('NZ', 'NZL', 554, 'New Zealand')
Country.NIC = Country('NI', 'NIC', 558, 'Nicaragua')
Country.NER = Country('NE', 'NER', 562, 'Niger')
Country.NGA = Country('NG', 'NGA', 566, 'Nigeria')
Country.NOR = Country('NO', 'NOR', 578, 'Norway')
Country.OMN = Country('OM', 'OMN', 512, 'Oman')
Country.PAK = Country('PK', 'PAK', 586, 'Pakistan')
Country.PLW = Country('PW', 'PLW', 585, 'Palau')
Country.PAN = Country('PA', 'PAN', 591, 'Panama')
Country.PNG = Country('PG', 'PNG', 598, 'Papua New Guinea')
Country.PRY = Country('PY', 'PRY', 600, 'Paraguay')
Country.PER = Country('PE', 'PER', 604, 'Peru')
Country.PHL = Country('PH', 'PHL', 608, 'Philippines')
Country.POL = Country('PL', 'POL', 616, 'Poland')
Country.PRT = Country('PT', 'PRT', 620, 'Portugal')
Country.QAT = Country('QA', 'QAT', 634, 'Qatar')
Country.ROU = Country('RO', 'ROU', 642, 'Romania')
Country.RUS = Country('RU', 'RUS', 643, 'Russia')
Country.RWA = Country('RW', 'RWA', 646, 'Rwanda')
Country.KNA = Country('KN', 'KNA', 659, 'Saint Kitts and Nevis')
Country.LCA = Country('LC', 'LCA', 662, 'Saint Lucia')
Country.VCT = Country('VC', 'VCT', 670, 'Saint Vincent and the Grenadines')
Country.WSM = Country('WS', 'WSM', 882, 'Samoa')
Country.SMR = Country('SM', 'SMR', 674, 'San Marino')
Country.STP = Country('ST', 'STP', 678, 'Sao Tome and Principe')
Country.SAU = Country('SA', 'SAU', 682, 'Saudi Arabia')
Country.SEN = Country('SN', 'SEN', 686, 'Senegal')
Country.SRB = Country('RS', 'SRB', 688, 'Serbia')
Country.SYC = Country('SC', 'SYC', 690, 'Seychelles')
Country.SLE = Country('SL', 'SLE', 694, 'Sierra Leone')
Country.SGP = Country('SG', 'SGP', 702, 'Singapore')
Country.SVK = Country('SK', 'SVK', 703, 'Slovakia')
Country.SVN = Country('SI', 'SVN', 705, 'Slovenia')
Country.SLB = Country('SB', 'SLB', 90, 'Solomon Islands')
Country.SOM = Country('SO', 'SOM', 706, 'Somalia')
Country.ZAF = Country('ZA', 'ZAF', 710, 'South Africa')
Country.ESP = Country('ES', 'ESP', 724, 'Spain')
Country.LKA = Country('LK', 'LKA', 144, 'Sri Lanka')
Country.SDN = Country('SD', 'SDN', 736, 'Sudan')
Country.SUR = Country('SR', 'SUR', 740, 'Suriname')
Country.SWZ = Country('SZ', 'SWZ', 748, 'Swaziland')
Country.SWE = Country('SE', 'SWE', 752, 'Sweden')
Country.CHE = Country('CH', 'CHE', 756, 'Switzerland')
Country.SYR = Country('SY', 'SYR', 760, 'Syria')
Country.TJK = Country('TJ', 'TJK', 762, 'Tajikistan')
Country.TZA = Country('TZ', 'TZA', 834, 'Tanzania')
Country.THA = Country('TH', 'THA', 764, 'Thailand')
Country.TLS = Country('TL', 'TLS', 626, 'Timor-Leste (East Timor)')
Country.TGO = Country('TG', 'TGO', 768, 'Togo')
Country.TON = Country('TO', 'TON', 776, 'Tonga')
Country.TTO = Country('TT', 'TTO', 780, 'Trinidad and Tobago')
Country.TUN = Country('TN', 'TUN', 788, 'Tunisia')
Country.TUR = Country('TR', 'TUR', 792, 'Turkey')
Country.TKM = Country('TM', 'TKM', 795, 'Turkmenistan')
Country.TUV = Country('TV', 'TUV', 798, 'Tuvalu')
Country.UGA = Country('UG', 'UGA', 800, 'Uganda')
Country.UKR = Country('UA', 'UKR', 804, 'Ukraine')
Country.ARE = Country('AE', 'ARE', 784, 'United Arab Emirates')
Country.GBR = Country('GB', 'GBR', 826, 'United Kingdom')
Country.USA = Country('US', 'USA', 840, 'United States')
Country.URY = Country('UY', 'URY', 858, 'Uruguay')
Country.UZB = Country('UZ', 'UZB', 860, 'Uzbekistan')
Country.VUT = Country('VU', 'VUT', 548, 'Vanuatu')
Country.VAT = Country('VA', 'VAT', 336, 'Vatican City')
Country.VEN = Country('VE', 'VEN', 862, 'Venezuela')
Country.VNM = Country('VN', 'VNM', 704, 'Vietnam')
Country.YEM = Country('YE', 'YEM', 887, 'Yemen')
Country.ZMB = Country('ZM', 'ZMB', 894, 'Zambia')
Country.ZWE = Country('ZW', 'ZWE', 716, 'Zimbabwe')
Country.GEO = Country('GE', 'GEO', 268, 'Abkhazia')
Country.TWN = Country('TW', 'TWN', 158, 'China, Republic of (Taiwan)')
Country.AZE = Country('AZ', 'AZE', 31, 'Nagorno-Karabakh')
Country.CYP = Country('CY', 'CYP', 196, 'Northern Cyprus')
Country.MDA = Country('MD', 'MDA', 498, 'Pridnestrovie (Transnistria)')
Country.SOM = Country('SO', 'SOM', 706, 'Somaliland')
Country.GEO = Country('GE', 'GEO', 268, 'South Ossetia')
Country.AUS = Country('AU', 'AUS', 36, 'Ashmore and Cartier Islands')
Country.CXR = Country('CX', 'CXR', 162, 'Christmas Island')
Country.CCK = Country('CC', 'CCK', 166, 'Cocos (Keeling) Islands')
Country.HMD = Country('HM', 'HMD', 334, 'Heard Island and McDonald Islands')
Country.NFK = Country('NF', 'NFK', 574, 'Norfolk Island')
Country.NCL = Country('NC', 'NCL', 540, 'New Caledonia')
Country.PYF = Country('PF', 'PYF', 258, 'French Polynesia')
Country.MYT = Country('YT', 'MYT', 175, 'Mayotte')
Country.GLP = Country('GP', 'GLP', 312, 'Saint Barthelemy')
Country.GLP = Country('GP', 'GLP', 312, 'Saint Martin')
Country.SPM = Country('PM', 'SPM', 666, 'Saint Pierre and Miquelon')
Country.WLF = Country('WF', 'WLF', 876, 'Wallis and Futuna')
Country.ATF = Country('TF', 'ATF', 260, 'French Southern and Antarctic Lands')
Country.PYF = Country('PF', 'PYF', 258, 'Clipperton Island')
Country.BVT = Country('BV', 'BVT', 74, 'Bouvet Island')
Country.COK = Country('CK', 'COK', 184, 'Cook Islands')
Country.NIU = Country('NU', 'NIU', 570, 'Niue')
Country.TKL = Country('TK', 'TKL', 772, 'Tokelau')
Country.GGY = Country('GG', 'GGY', 831, 'Guernsey')
Country.IMN = Country('IM', 'IMN', 833, 'Isle of Man')
Country.JEY = Country('JE', 'JEY', 832, 'Jersey')
Country.AIA = Country('AI', 'AIA', 660, 'Anguilla')
Country.BMU = Country('BM', 'BMU', 60, 'Bermuda')
Country.IOT = Country('IO', 'IOT', 86, 'British Indian Ocean Territory')
Country.VGB = Country('VG', 'VGB', 92, 'British Virgin Islands')
Country.CYM = Country('KY', 'CYM', 136, 'Cayman Islands')
Country.FLK = Country('FK', 'FLK', 238, 'Falkland Islands (Islas Malvinas)')
Country.GIB = Country('GI', 'GIB', 292, 'Gibraltar')
Country.MSR = Country('MS', 'MSR', 500, 'Montserrat')
Country.PCN = Country('PN', 'PCN', 612, 'Pitcairn Islands')
Country.SHN = Country('SH', 'SHN', 654, 'Saint Helena')
Country.SGS = Country('GS', 'SGS', 239, 'South Georgia and the South Sandwich Islands')
Country.TCA = Country('TC', 'TCA', 796, 'Turks and Caicos Islands')
Country.MNP = Country('MP', 'MNP', 580, 'Northern Mariana Islands')
Country.PRI = Country('PR', 'PRI', 630, 'Puerto Rico')
Country.ASM = Country('AS', 'ASM', 16, 'American Samoa')
Country.GUM = Country('GU', 'GUM', 316, 'Guam')
Country.UMI = Country('UM', 'UMI', 581, 'United States Minor Outlying Islands')
Country.VIR = Country('VI', 'VIR', 850, 'U.S. Virgin Islands')
Country.HKG = Country('HK', 'HKG', 344, 'Hong Kong')
Country.MAC = Country('MO', 'MAC', 446, 'Macau')
Country.FRO = Country('FO', 'FRO', 234, 'Faroe Islands')
Country.GRL = Country('GL', 'GRL', 304, 'Greenland')
Country.GUF = Country('GF', 'GUF', 254, 'French Guiana')
Country.GLP = Country('GP', 'GLP', 312, 'Guadeloupe')
Country.MTQ = Country('MQ', 'MTQ', 474, 'Martinique')
Country.REU = Country('RE', 'REU', 638, 'Reunion')
Country.ALA = Country('AX', 'ALA', 248, 'Aland')
Country.ABW = Country('AW', 'ABW', 533, 'Aruba')
Country.ANT = Country('AN', 'ANT', 530, 'Netherlands Antilles')
Country.SJM = Country('SJ', 'SJM', 744, 'Svalbard')
Country.ATA = Country('AQ', 'ATA', 10, 'Antarctica')
Country.SCG = Country('CS', 'SCG', 891, 'Kosovo')
Country.PSE = Country('PS', 'PSE', 275, 'Palestinian Territories (Gaza Strip and West Bank)')
Country.ESH = Country('EH', 'ESH', 732, 'Western Sahara')
Country.all = sorted(Country.all, key=lambda country: country.name)
Country.choices = ((country.iso_a2, country.name) for country in Country.all)
