-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_methods.py
93 lines (81 loc) · 2.51 KB
/
my_methods.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
# This contains the list of specializations
class Tag:
tags = ['Agricultural Business',
'Agricultural Economics',
'Agricultural Equipment',
'Agricultural Management',
'Agronomy',
'Animal Husbandry', 'Crop Production', 'Fishery',
'Food Science', 'Forestry', 'Horticulture', 'Soil Science', 'Tropical Agriculture',
'Veterinary Science', 'Water Science']
# This contains the list of banks
class Bank:
bank = ['First Bank of Nigeria Limited', 'Fidelity Bank Plc',
'First City Monument Bank Plc', 'Access Bank Plc',
'Guaranty Trust Bank Plc', 'Union Bank of Nigeria Plc', 'United Bank for Africa Plc',
'Zenith Bank Plc', 'Citibank Nigeria Limited', 'Ecobank Nigeria Plc',
'Heritage Banking Company Limited', 'Keystone Bank Limited',
'Polaris Bank Limited.', 'Stanbic IBTC Bank Plc', 'Standard Chartered', 'Sterling Bank Plc',
'Unity Bank Plc', 'Wema Bank Plc'
]
# This contains the list of states in Nigeria
class State:
states = [
' Abia ',
' Adamawa ',
' AkwaIbom ',
' Anambra ',
' Bauchi ',
' Benue ',
' Bornu ',
' Bayelsa ',
' CrossRiver ',
' Delta ',
' Edo ',
' Enugu ',
' Imo ',
' Jigawa ',
' Lagos ',
' Kogi ',
' Nassarawa ',
' Gombe ',
' Kaduna ',
' Kano ',
' Kastina ',
' Kebbi ',
' Niger ',
' Ogun ',
' Ondo ',
' Osun ',
' Oyo ',
' Plateu ',
' Rivers ',
' Sokoto ',
' Taraba ',
' Yobe ',
' Zamfara ',
' Abuja ',
]
# This function paginates a list item
def get_pagination(page, item):
paginator = Paginator(item, 10)
try:
pages = paginator.page(page)
return pages
except PageNotAnInteger:
pages = paginator.page(1)
return pages
except EmptyPage:
pages = paginator.page(paginator.num_pages)
return pages
degrees = ['No Degree', 'First School leaving certificate', 'WASSCE', 'NCE', 'ND', 'HND', 'BA', 'BSc', 'BEngr', 'MSc',
'PGD',
'PHD', 'Doctorate Degree']
def degree_to_title(argument):
switcher = {
'Doctorate Degree': 'Dr. ',
'PHD': 'Prof. ',
'BEngr': 'Engr. '
}
return switcher.get(argument, 'None')