-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 659-create-lyche-about-us-page
- Loading branch information
Showing
42 changed files
with
1,006 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ ENABLE_DEBUGPY=yes | |
# Automatically create local superuser | ||
DJANGO_SUPERUSER_USERNAME=emilte | ||
DJANGO_SUPERUSER_PASSWORD=Django123 | ||
DJANGO_SUPERUSER_EMAIL=[email protected] | ||
DJANGO_SUPERUSER_EMAIL=[email protected] | ||
|
||
DOMAIN=0.0.0.0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
backend/root/management/commands/seed_scripts/textitems.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from samfundet.models.general import TextItem | ||
|
||
|
||
def seed(): | ||
text_items = [ | ||
{ | ||
'key': 'welcome_message', | ||
'text_nb': 'Velkommen til Studentersamfundet i Trondhjem!', | ||
'text_en': 'Welcome to the Student Society in Trondheim!', | ||
}, | ||
{ | ||
'key': 'upcoming_events', | ||
'text_nb': 'Sjekk ut våre kommende arrangementer og konsertene vi har planlagt!', | ||
'text_en': 'Check out our upcoming events and concerts we have planned!', | ||
}, | ||
{ | ||
'key': 'join_us', | ||
'text_nb': 'Bli medlem av Studentersamfundet og nyt godt av medlemsfordelene!', | ||
'text_en': 'Join the Student Society and enjoy the benefits of membership!', | ||
}, | ||
{ | ||
'key': 'volunteer', | ||
'text_nb': 'Vil du bli frivillig? Bli med i vårt fantastiske team og bidra til studentkulturen i Trondheim!', | ||
'text_en': 'Want to volunteer? Join our amazing team and contribute to the student culture in Trondheim!', | ||
}, | ||
{ | ||
'key': 'about_us', | ||
'text_nb': 'Studentersamfundet i Trondhjem er et kulturelt senter for studenter og en viktig del av studentlivet i Trondheim.', | ||
'text_en': 'The Student Society in Trondheim is a cultural center for students and an essential part of student life in Trondheim.', | ||
}, | ||
{ | ||
'key': 'contact_us', | ||
'text_nb': 'Har du spørsmål eller ønsker å komme i kontakt med oss? Ikke nøl med å ta kontakt!', | ||
'text_en': 'Do you have any questions or want to get in touch with us? Don"t hesitate to contact us!', | ||
}, | ||
] | ||
|
||
TextItem.objects.all().delete() | ||
yield 0, 'Deleted old textitems' | ||
|
||
for i, item in enumerate(text_items): | ||
text_item, created = TextItem.objects.get_or_create(key=item['key'], text_nb=item['text_nb'], text_en=item['text_en']) | ||
if created: | ||
yield (100 * (i + 1) // len(text_items), f'Created {len(TextItem.objects.all())} textitems') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.