load_all.py 1.01 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.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
11

Florent Chehab's avatar
Florent Chehab committed
12
13

def load_all():
14
15
    """
    Function to load all the initial data in the app
Florent Chehab's avatar
Florent Chehab committed
16
17
    """

Florent Chehab's avatar
Florent Chehab committed
18
    with reversion.create_revision():
19
        LoadGroups()
Florent Chehab's avatar
Florent Chehab committed
20
21
22
23
24
        admin = LoadAdminUser().get()
        LoadCurrencies(admin).load()
        LoadCountries(admin).load()
        LoadUniversities(admin).load()
        LoadTags(admin).load()
Segolene Brisemeur's avatar
Segolene Brisemeur committed
25
        LoadLanguages().load()
Florent Chehab's avatar
Florent Chehab committed
26
        LoadUniversityEx(admin).load()