load_all.py 1.3 KB
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
import reversion
Florent Chehab's avatar
Florent Chehab committed
2

3
4
5
6
from backend_app.load_data.loading_scripts.loadAdminUser import LoadAdminUser
from backend_app.load_data.loading_scripts.loadCountries import LoadCountries
from backend_app.load_data.loading_scripts.loadCurrencies import LoadCurrencies
from backend_app.load_data.loading_scripts.loadGroups import LoadGroups
Segolene Brisemeur's avatar
Segolene Brisemeur committed
7
from backend_app.load_data.loading_scripts.loadLanguages import LoadLanguages
8
9
10
from backend_app.load_data.loading_scripts.loadRecommendationLists import (
    LoadRecommendationLists,
)
11
12
13
14
15
16
from backend_app.load_data.loading_scripts.loadSiteInformation import (
    LoadSiteInformation,
)
from backend_app.load_data.loading_scripts.loadTags import LoadTags
from backend_app.load_data.loading_scripts.loadUniversities import LoadUniversities
from backend_app.load_data.loading_scripts.loadUniversityEx import LoadUniversityEx
Florent Chehab's avatar
Florent Chehab committed
17

Florent Chehab's avatar
Florent Chehab committed
18
19

def load_all():
20
21
    """
    Function to load all the initial data in the app
Florent Chehab's avatar
Florent Chehab committed
22
23
    """

Florent Chehab's avatar
Florent Chehab committed
24
    with reversion.create_revision():
25
        LoadGroups()
Florent Chehab's avatar
Florent Chehab committed
26
27
28
29
30
        admin = LoadAdminUser().get()
        LoadCurrencies(admin).load()
        LoadCountries(admin).load()
        LoadUniversities(admin).load()
        LoadTags(admin).load()
Segolene Brisemeur's avatar
Segolene Brisemeur committed
31
        LoadLanguages().load()
Florent Chehab's avatar
Florent Chehab committed
32
        LoadUniversityEx(admin).load()
33
        LoadRecommendationLists(admin).load()
34
        LoadSiteInformation(admin).load()