Skip to content

Commit d45a798

Browse files
committed
Add seed data for custom placeholders
1 parent 32689d9 commit d45a798

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

populate_db.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
# EventLocation
4141
from app.models.event_location import EventLocation
4242

43+
# Custom Placeholder
44+
from app.models.custom_placeholder import CustomPlaceholder
45+
4346
# User Permissions
4447
from app.models.user_permission import UserPermission
4548
SALES = 'sales'
@@ -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='Default Placeholder', original_image_url='https://www.w3schools.com/html/pic_mountain.jpg')
319+
db.session.add(custom_placeholder)
320+
321+
314322
def 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

352362
def 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

Comments
 (0)