|
7 | 7 | from .models import (LearnPythonCourse, GraduateProjects, |
8 | 8 | LearnPythonCoursePrices, |
9 | 9 | Feedback, Curators, GraduateStories, GraduateProjectsVideos, |
10 | | - Podcasts,) |
| 10 | + Podcasts, LearnPythonMultiCityCourses,) |
11 | 11 | from datetime import date |
12 | 12 | import json |
13 | 13 |
|
@@ -51,80 +51,20 @@ def index(request): |
51 | 51 | is_online_closed = current_course.online_session_closed |
52 | 52 |
|
53 | 53 | is_offline_closed = current_course.offline_session_closed |
54 | | - |
55 | | - offline_cities = [ |
56 | | - { |
57 | | - 'name': 'Москва', |
58 | | - 'coords': [55.755988, 37.643448], |
59 | | - 'early_date': '2021-03-31', |
60 | | - 'early_price': 36500, |
61 | | - 'early_installment_price': 3500, |
62 | | - 'basic_date': '2021-04-01', |
63 | | - 'basic_price': 36500, |
64 | | - 'basic_installment_price': 3500 |
65 | | - }, |
66 | | - { |
67 | | - 'name': 'Санкт-Петербург', |
68 | | - 'coords': [59.935800, 30.318139], |
69 | | - 'early_date': '2021-04-30', |
70 | | - 'early_price': 36500, |
71 | | - 'early_installment_price': 3500, |
72 | | - 'basic_date': '2021-05-01', |
73 | | - 'basic_price': 36500, |
74 | | - 'basic_installment_price': 3500 |
75 | | - }, |
76 | | - { |
77 | | - 'name': 'Екатеринбург', |
78 | | - 'coords': [56.826403, 60.614272], |
79 | | - 'early_date': '2021-05-31', |
80 | | - 'early_price': 36500, |
81 | | - 'early_installment_price': 3500, |
82 | | - 'basic_date': '2021-06-01', |
83 | | - 'basic_price': 36500, |
84 | | - 'basic_installment_price': 3500 |
85 | | - }, |
86 | | - { |
87 | | - 'name': 'Самара', |
88 | | - 'coords': [53.192632, 50.110934], |
89 | | - 'early_date': '2021-06-30', |
90 | | - 'early_price': 36500, |
91 | | - 'early_installment_price': 3500, |
92 | | - 'basic_date': '2021-07-01', |
93 | | - 'basic_price': 36500, |
94 | | - 'basic_installment_price': 3500 |
95 | | - }, |
96 | | - { |
97 | | - 'name': 'Тольятти', |
98 | | - 'coords': [53.503970, 49.424335], |
99 | | - 'early_date': '2021-07-31', |
100 | | - 'early_price': 36500, |
101 | | - 'early_installment_price': 3500, |
102 | | - 'basic_date': '2021-08-01', |
103 | | - 'basic_price': 36500, |
104 | | - 'basic_installment_price': 3500 |
105 | | - }, |
106 | | - { |
107 | | - 'name': 'Сызрань', |
108 | | - 'coords': [53.150426, 48.475794], |
109 | | - 'early_date': '2021-08-31', |
110 | | - 'early_price': 36500, |
111 | | - 'early_installment_price': 3500, |
112 | | - 'basic_date': '2021-09-01', |
113 | | - 'basic_price': 36500, |
114 | | - 'basic_installment_price': 3500 |
115 | | - }, |
116 | | - { |
117 | | - 'name': 'Казань', |
118 | | - 'coords': [55.795976, 49.111556], |
119 | | - 'early_date': '2021-09-30', |
120 | | - 'early_price': 36500, |
121 | | - 'early_installment_price': 3500, |
122 | | - 'basic_date': '2021-10-01', |
123 | | - 'basic_price': 36500, |
124 | | - 'basic_installment_price': 3500 |
125 | | - } |
126 | | - |
127 | | - ] |
| 54 | + |
| 55 | + listed_cities = [city for city in LearnPythonMultiCityCourses.objects.all()] |
| 56 | + |
| 57 | + offline_cities = [ |
| 58 | + {'name': city.city_name, |
| 59 | + 'coords': [float(city.long), float(city.lat)], |
| 60 | + 'early_date': str(city.early_date), |
| 61 | + 'early_price': str(city.early_price), |
| 62 | + 'early_installment_price': city.early_installment_price, |
| 63 | + 'basic_date': str(city.basic_date), |
| 64 | + 'basic_price': str(city.basic_price), |
| 65 | + 'basic_installment_price': city.basic_installment_price |
| 66 | + } for city in listed_cities |
| 67 | + ] |
128 | 68 |
|
129 | 69 | context = { |
130 | 70 | 'course': current_course, |
|
0 commit comments