It is no longer possible in Django 1.7 to reference a model at import time.
This commit is contained in:
parent
48fb14d2a9
commit
d17efc19da
|
@ -0,0 +1,13 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class DossiersConfig(AppConfig):
|
||||
name = 'calebasse.dossiers'
|
||||
|
||||
def ready(self):
|
||||
PatientRecord = self.get_model('PatientRecord')
|
||||
PatientRecord.DEFICIENCY_FIELDS = [field for field in PatientRecord._meta.get_all_field_names() if field.startswith('deficiency_')]
|
||||
PatientRecord.MISES_FIELDS = [field for field in PatientRecord._meta.get_all_field_names() if field.startswith('mises_')]
|
||||
|
||||
|
||||
default_app_config = 'calebasse.dossiers.DossiersConfig'
|
|
@ -1063,6 +1063,3 @@ def create_patient(first_name, last_name, service, creator,
|
|||
patient.policyholder = patient.patientcontact
|
||||
patient.save()
|
||||
return patient
|
||||
|
||||
PatientRecord.DEFICIENCY_FIELDS = [field for field in PatientRecord._meta.get_all_field_names() if field.startswith('deficiency_')]
|
||||
PatientRecord.MISES_FIELDS = [field for field in PatientRecord._meta.get_all_field_names() if field.startswith('mises_')]
|
||||
|
|
Reference in New Issue