Example #1
0
        def get_validity(row):
            """
                takes a db.school_classcards() row as argument
            """
            validity = SPAN(unicode(row.Validity), ' ')

            validity_in = represent_validity_units(row.ValidityUnit, row)
            if row.Validity == 1:  # Cut the last 's"
                validity_in = validity_in[:-1]

            validity.append(validity_in)

            return validity
Example #2
0
    def get_validity_formatted(self):
        """
            :return: Validity for school membership
        """
        from general_helpers import represent_validity_units

        T = current.T
        db = current.db

        validity = SPAN(unicode(self.row.Validity), ' ')

        validity_in = represent_validity_units(self.row.ValidityUnit, self.row)
        if self.row.Validity == 1:  # Cut the last 's"
            validity_in = validity_in[:-1]

        validity.append(validity_in)

        return validity
    def get_validity_formatted(self):
        """
            :return: Validity for school classcard
        """
        from general_helpers import represent_validity_units

        T = current.T
        db = current.db

        row = db.school_classcards(self.scdID)
        validity = SPAN(str(row.Validity), ' ')

        validity_in = represent_validity_units(row.ValidityUnit, row)
        if row.Validity == 1:  # Cut the last 's"
            validity_in = validity_in[:-1]

        validity.append(validity_in)

        return validity