Projet

Général

Profil

« Précédent | Suivant » 

Révision a2e49cca

Ajouté par Mikaël Ates il y a plus de 9 ans

agenda: prevent periodic modification and deletion if one act is not new.

Voir les différences:

calebasse/agenda/models.py
395 395
                models.Q(parent_event=self) | \
396 396
                models.Q(parent_event__exception_to=self))
397 397

  
398
    def one_act_not_new(self):
399
        '''
400
            Return True if at least one act of the present event or an act
401
            of one of its exceptions is not new.
402
        '''
403
        return True if [a for a in self.acts if not a.is_new()] else False
404

  
405
    def last_act_not_new(self):
406
        '''
407
            Return True if at least one act of the present event or an act
408
            of one of its exceptions is not new.
409
        '''
410
        act = None
411
        for a in self.acts:
412
            if not a.is_new():
413
                if not act or a.date > act.date:
414
                    act = a
415
        return act
416

  
398 417
    def one_act_already_billed(self):
399 418
        '''
400 419
            Return True if at least one act of the present event or an act

Formats disponibles : Unified diff