def load_edc():

    if 'test' in sys.argv:
        f = open(os.path.join(
                 Path(os.path.dirname(os.path.realpath(__file__))).ancestor(1).child('td_maternal').child('tests'), 'test_randomization.csv'))
    # else:
    #    f = open(os.path.join(
    #             Path(os.path.dirname(os.path.realpath(__file__))).ancestor(2).child('etc'), 'randomization.csv'))
    # for index, line in enumerate(f.readlines()):
    #    if index == 0:
    #        continue
    #    seq, drug_assignment = line.split(',')
    #    RandomizationItem.objects.get_or_create(name=seq, field_name=drug_assignment)

    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()
Example #2
0
def load_edc():

    if 'test' in sys.argv:
        f = open(
            os.path.join(
                Path(os.path.dirname(os.path.realpath(__file__))).ancestor(
                    1).child('td_maternal').child('tests'),
                'test_randomization.csv'))
    # else:
    #    f = open(os.path.join(
    #             Path(os.path.dirname(os.path.realpath(__file__))).ancestor(2).child('etc'), 'randomization.csv'))
    # for index, line in enumerate(f.readlines()):
    #    if index == 0:
    #        continue
    #    seq, drug_assignment = line.split(',')
    #    RandomizationItem.objects.get_or_create(name=seq, field_name=drug_assignment)

    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()
 def ready(self):
     from edc_call_manager import signals
     from edc_call_manager.caller_site import site_model_callers
     sys.stdout.write(f'Loading {self.verbose_name} ...\n')
     sys.stdout.write(f' * call models are in app {self.name}.\n')
     site_model_callers.autodiscover()
     sys.stdout.write(f' Done loading {self.verbose_name}.\n')
Example #4
0
 def ready(self):
     from edc_call_manager import signals
     from edc_call_manager.caller_site import site_model_callers
     sys.stdout.write('Loading {} ...\n'.format(self.verbose_name))
     sys.stdout.write(' * call models are in app {}.\n'.format(
         self.app_label))
     site_model_callers.autodiscover()
     sys.stdout.write(' Done loading {}.\n'.format(self.verbose_name))
Example #5
0
def load_edc():
    edc_base_startup()
    site_lab_profiles.autodiscover()
    AppConfiguration(lab_profiles=site_lab_profiles).prepare()
    site_visit_schedules.autodiscover()
    site_visit_schedules.build_all()
    site_rule_groups.autodiscover()
    data_manager.prepare()
    site_sections.autodiscover()
    site_sections.update_section_lists()
    site_model_callers.autodiscover()
    admin.autodiscover()

    for model in get_models():
        try:
            django_databrowse.site.register(model)
        except:
            pass
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Erik van Widenfelt
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from django.conf.urls import include, url
from django.contrib import admin

from edc_base.utils import edc_base_startup
from edc_call_manager.caller_site import site_model_callers

edc_base_startup()
admin.autodiscover()
site_model_callers.autodiscover()

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
]