Project

General

Profile

« Previous | Next » 

Revision 3e915eb3

Added by Jérôme Schneider over 11 years ago

dossiers: only show patientrecord from the current service

View differences:

calebasse/dossiers/models.py
219 219
            blank=True, null=True)
220 220

  
221 221

  
222
class PatientRecordManager(models.Manager):
223
    def for_service(self, service):
224
        return self.filter(service=service)
225

  
222 226
class PatientRecord(ServiceLinkedAbstractModel, PatientContact):
227
    objects = PatientRecordManager()
228

  
223 229
    class Meta:
224 230
        verbose_name = u'Dossier'
225 231
        verbose_name_plural = u'Dossiers'
calebasse/dossiers/views.py
117 117
            for state in states:
118 118
                status_types.append(STATE_CHOICES_TYPE[state])
119 119
            qs = qs.filter(last_state__status__type__in=status_types)
120
        qs = qs.filter(service=self.service)
120 121
        return qs
121 122

  
122 123
    def get_context_data(self, **kwargs):

Also available in: Unified diff