Project

General

Profile

« Previous | Next » 

Revision d17efc19

Added by Mikaël Ates over 8 years ago

It is no longer possible in Django 1.7 to reference a model at import time.

View differences:

calebasse/dossiers/__init__.py
1
from django.apps import AppConfig
2

  
3

  
4
class DossiersConfig(AppConfig):
5
    name = 'calebasse.dossiers'
6

  
7
    def ready(self):
8
        PatientRecord = self.get_model('PatientRecord')
9
        PatientRecord.DEFICIENCY_FIELDS = [field for field in PatientRecord._meta.get_all_field_names() if field.startswith('deficiency_')]
10
        PatientRecord.MISES_FIELDS = [field for field in PatientRecord._meta.get_all_field_names() if field.startswith('mises_')]
11

  
12

  
13
default_app_config = 'calebasse.dossiers.DossiersConfig'

Also available in: Unified diff