|
1 | 1 | from django.core.management.base import BaseCommand |
2 | 2 | from wagtail.models import Page, Site |
3 | 3 |
|
4 | | -from core.factories import SponsorshipLevelFactory, MeetupFactory, HomePageFactory, SimplePageFactory |
| 4 | +from core.factories import ( |
| 5 | + HomePageFactory, |
| 6 | + MeetupFactory, |
| 7 | + SimplePageFactory, |
| 8 | + SponsorshipLevelFactory, |
| 9 | +) |
5 | 10 | from core.models import HomePage, SimplePage |
6 | 11 |
|
7 | 12 |
|
@@ -84,45 +89,62 @@ def _create_page(self, parent, title, slug, body=None): |
84 | 89 | self.stdout.write(f" {title} already exists") |
85 | 90 | return SimplePage.objects.get(slug=slug) |
86 | 91 |
|
87 | | - page = SimplePageFactory.build(title=title, slug=slug, body=body or [], show_in_menus=True) |
| 92 | + page = SimplePageFactory.build( |
| 93 | + title=title, slug=slug, body=body or [], show_in_menus=True |
| 94 | + ) |
88 | 95 | parent.add_child(instance=page) |
89 | 96 | self.stdout.write(self.style.SUCCESS(f"Created {title}")) |
90 | 97 | return page |
91 | 98 |
|
92 | 99 | def _get_home_content(self): |
93 | 100 | return [ |
94 | 101 | {"type": "heading", "value": "Introduction"}, |
95 | | - {"type": "paragraph", "value": ( |
96 | | - "<p>Python Ireland is the Irish organisation representing the various chapters of Python users. " |
97 | | - "We organise meet ups and events for software developers, students, academics and anyone who wants " |
98 | | - "to learn the language. One of our aims is to help grow and diversify the Python community in Ireland. " |
99 | | - "We also develop and foster links with other Python based communities overseas.</p>" |
100 | | - )}, |
| 102 | + { |
| 103 | + "type": "paragraph", |
| 104 | + "value": ( |
| 105 | + "<p>Python Ireland is the Irish organisation representing the various chapters of Python users. " |
| 106 | + "We organise meet ups and events for software developers, students, academics and anyone who wants " |
| 107 | + "to learn the language. One of our aims is to help grow and diversify the Python community in Ireland. " |
| 108 | + "We also develop and foster links with other Python based communities overseas.</p>" |
| 109 | + ), |
| 110 | + }, |
101 | 111 | {"type": "heading", "value": "PyCon Ireland 2025"}, |
102 | | - {"type": "paragraph", "value": ( |
103 | | - "<p>We are thrilled to announce PyCon Ireland 2025, taking place in Dublin " |
104 | | - "on November 15th and 16th! Join us at the UCD O'Reilly Hall for this exciting event.</p>" |
105 | | - )}, |
106 | | - {"type": "paragraph", "value": ( |
107 | | - "<p>PyCon Ireland 2025 will feature two talk tracks and two workshop tracks on both days. " |
108 | | - "Your ticket includes breakfast and lunch. Join us Saturday evening for networking!</p>" |
109 | | - )}, |
110 | | - {"type": "paragraph", "value": ( |
111 | | - "<p>Please adhere to our <a href='/policies/code-of-conduct/'>Code of Conduct</a>. " |
112 | | - "Check <a href='/pycon-2025/'>Terms and conditions</a> for details.</p>" |
113 | | - )}, |
| 112 | + { |
| 113 | + "type": "paragraph", |
| 114 | + "value": ( |
| 115 | + "<p>We are thrilled to announce PyCon Ireland 2025, taking place in Dublin " |
| 116 | + "on November 15th and 16th! Join us at the UCD O'Reilly Hall for this exciting event.</p>" |
| 117 | + ), |
| 118 | + }, |
| 119 | + { |
| 120 | + "type": "paragraph", |
| 121 | + "value": ( |
| 122 | + "<p>PyCon Ireland 2025 will feature two talk tracks and two workshop tracks on both days. " |
| 123 | + "Your ticket includes breakfast and lunch. Join us Saturday evening for networking!</p>" |
| 124 | + ), |
| 125 | + }, |
| 126 | + { |
| 127 | + "type": "paragraph", |
| 128 | + "value": ( |
| 129 | + "<p>Please adhere to our <a href='/policies/code-of-conduct/'>Code of Conduct</a>. " |
| 130 | + "Check <a href='/pycon-2025/'>Terms and conditions</a> for details.</p>" |
| 131 | + ), |
| 132 | + }, |
114 | 133 | {"type": "paragraph", "value": "<p>See you at PyCon Ireland 2025!</p>"}, |
115 | 134 | ] |
116 | 135 |
|
117 | 136 | def _get_meetups_content(self): |
118 | 137 | return [ |
119 | 138 | {"type": "heading", "value": "Python Ireland Meetups"}, |
120 | | - {"type": "paragraph", "value": ( |
121 | | - "<p>Join us at our regular meetups! We hold events every month.</p>" |
122 | | - "<ul>" |
123 | | - "<li><a href='https://www.meetup.com/pythonireland/events/'>Upcoming Events</a></li>" |
124 | | - "<li><a href='https://www.meetup.com/pythonireland/photos/'>Photos</a></li>" |
125 | | - "<li><a href='https://www.meetup.com/pythonireland/'>Python Ireland on Meetup.com</a></li>" |
126 | | - "</ul>" |
127 | | - )}, |
| 139 | + { |
| 140 | + "type": "paragraph", |
| 141 | + "value": ( |
| 142 | + "<p>Join us at our regular meetups! We hold events every month.</p>" |
| 143 | + "<ul>" |
| 144 | + "<li><a href='https://www.meetup.com/pythonireland/events/'>Upcoming Events</a></li>" |
| 145 | + "<li><a href='https://www.meetup.com/pythonireland/photos/'>Photos</a></li>" |
| 146 | + "<li><a href='https://www.meetup.com/pythonireland/'>Python Ireland on Meetup.com</a></li>" |
| 147 | + "</ul>" |
| 148 | + ), |
| 149 | + }, |
128 | 150 | ] |
0 commit comments