app/lists.py
def calc_frequency(self, date_created, campaign_count):
        """Calculates the average number of days per campaign sent. Automatically
        zero if fewer than 10 campaigns have been sent total."""
        campaign_count = int(campaign_count)
        if campaign_count < 10:
            self.frequency = 0
        else:
            now = datetime.now(timezone.utc)
            created = (iso8601.parse_date(date_created)
                       if isinstance(date_created, str)
                       else date_created.replace(tzinfo=timezone.utc))
            list_age = now - created
            self.frequency = list_age.days / campaign_count
Calculates the average number of days per campaign sent. Automatically
        zero if fewer than 10 campaigns have been sent total.
Calculates the average number of days per campaign sent. Automatically
zero if fewer than 10 campaigns have been sent total.
Calculates the average number of days per campaign sent . Automatically zero if fewer than 10 campaigns have been sent total .
def calc_frequency(self, date_created, campaign_count):
        campaign_count = int(campaign_count)
        if campaign_count < 10:
            self.frequency = 0
        else:
            now = datetime.now(timezone.utc)
            created = (iso8601.parse_date(date_created)
                       if isinstance(date_created, str)
                       else date_created.replace(tzinfo=timezone.utc))
            list_age = now - created
            self.frequency = list_age.days / campaign_count
def calc_frequency ( self , date_created , campaign_count ) : campaign_count = int ( campaign_count ) if campaign_count < 10 : self . frequency = 0 else : now = datetime . now ( timezone . utc ) created = ( iso8601 . parse_date ( date_created ) if isinstance ( date_created , str ) else date_created . replace ( tzinfo = timezone . utc ) ) list_age = now - created self . frequency = list_age . days / campaign_count
Calculates the average number of days per campaign sent.
Calculates the average number of days per campaign sent .
"""Calculates the average number of days per campaign sent. Automatically
        zero if fewer than 10 campaigns have been sent total."""
self
date_created
campaign_count