4040# EventLocation
4141from app .models .event_location import EventLocation
4242
43+ # Custom Placeholder
44+ from app .models .custom_placeholder import CustomPlaceholder
45+
4346# User Permissions
4447from app .models .user_permission import UserPermission
4548SALES = 'sales'
@@ -174,7 +177,7 @@ def create_event_sub_topics():
174177 "Religion & Spirituality" : ["Mysticism and Occult" ],
175178 "Government & Politics" : ["Non-partisan" ]
176179 }
177- eventopics = db .session .query (EventTopic ).all ()
180+ eventopics = db .session .query (EventTopic ).all ()
178181 for keysub_topic in event_sub_topic :
179182 for subtopic in event_sub_topic [keysub_topic ]:
180183 get_or_create (EventSubTopic , name = subtopic , event_topic_id = next (x for x in eventopics if x .name == keysub_topic ).id )
@@ -311,6 +314,11 @@ def create_admin_message_settings():
311314 )
312315
313316
317+ def create_custom_placeholders ():
318+ custom_placeholder , _ = get_or_create (CustomPlaceholder , name = 'Hills' , original_image_url = 'https://www.w3schools.com/html/pic_mountain.jpg' , event_sub_topic_id = 1 )
319+ db .session .add (custom_placeholder )
320+
321+
314322def populate ():
315323 """
316324 Create defined Roles, Services and Permissions.
@@ -347,6 +355,8 @@ def populate():
347355 create_event_locations ()
348356 print ('Creating admin message settings...' )
349357 create_admin_message_settings ()
358+ print ('Creating custom placeholders...' )
359+ create_custom_placeholders ()
350360
351361
352362def populate_without_print ():
@@ -369,6 +379,7 @@ def populate_without_print():
369379 create_event_types ()
370380 create_event_locations ()
371381 create_admin_message_settings ()
382+ create_custom_placeholders ()
372383
373384 db .session .commit ()
374385
0 commit comments