예제 #1
0
    def get_full_name(self,
                      last_name_first=True,
                      last_name_upper=True,
                      abbrev_first_name=True,
                      show_title=False,
                      _show_empty_names=False):
        """Return the person's name in the specified notation.

        Note: Do not use positional arguments when calling this method.
        Always use keyword arguments!

        :param last_name_first: if "lastname, firstname" instead of
                                "firstname lastname" should be used
        :param last_name_upper: if the last name should be all-uppercase
        :param abbrev_first_name: if the first name should be abbreviated to
                                  use only the first character
        :param show_title: if the title of the person should be included
        """
        first_name = self.first_name if self.first_name or not _show_empty_names else 'Unknown'
        last_name = self.last_name if self.last_name or not _show_empty_names else 'Unknown'
        return format_full_name(first_name,
                                last_name,
                                self.title,
                                last_name_first=last_name_first,
                                last_name_upper=last_name_upper,
                                abbrev_first_name=abbrev_first_name,
                                show_title=show_title)
예제 #2
0
    def get_full_name(self, last_name_first=True, last_name_upper=True, abbrev_first_name=True, show_title=False):
        """Returns the user's name in the specified notation.

        Note: Do not use positional arguments when calling this method.
        Always use keyword arguments!

        :param last_name_first: if "lastname, firstname" instead of
                                "firstname lastname" should be used
        :param last_name_upper: if the last name should be all-uppercase
        :param abbrev_first_name: if the first name should be abbreviated to
                                  use only the first character
        :param show_title: if the title of the user should be included
        """
        # Pending users might not have a first/last name...
        first_name = self.first_name or "Unknown"
        last_name = self.last_name or "Unknown"
        return format_full_name(
            first_name,
            last_name,
            self.title,
            last_name_first=last_name_first,
            last_name_upper=last_name_upper,
            abbrev_first_name=abbrev_first_name,
            show_title=show_title,
        )
예제 #3
0
    def get_full_name(self, last_name_first=True, last_name_upper=False, abbrev_first_name=False):
        """Returns the user's in the specified notation.

        If not format options are specified, the name is returned in
        the 'Lastname, Firstname' notation.

        Note: Do not use positional arguments when calling this method.
        Always use keyword arguments!

        :param last_name_first: if "lastname, firstname" instead of
                                "firstname lastname" should be used
        :param last_name_upper: if the last name should be all-uppercase
        :param abbrev_first_name: if the first name should be abbreviated to
                                  use only the first character
        """
        return format_full_name(self.first_name, self.last_name,
                                last_name_first=last_name_first, last_name_upper=last_name_upper,
                                abbrev_first_name=abbrev_first_name)
예제 #4
0
파일: users.py 프로젝트: indico/indico
    def get_full_name(self, last_name_first=True, last_name_upper=True, abbrev_first_name=True, show_title=False,
                      _show_empty_names=False):
        """Return the person's name in the specified notation.

        Note: Do not use positional arguments when calling this method.
        Always use keyword arguments!

        :param last_name_first: if "lastname, firstname" instead of
                                "firstname lastname" should be used
        :param last_name_upper: if the last name should be all-uppercase
        :param abbrev_first_name: if the first name should be abbreviated to
                                  use only the first character
        :param show_title: if the title of the person should be included
        """
        first_name = self.first_name if self.first_name or not _show_empty_names else 'Unknown'
        last_name = self.last_name if self.last_name or not _show_empty_names else 'Unknown'
        return format_full_name(first_name, last_name, self.title,
                                last_name_first=last_name_first, last_name_upper=last_name_upper,
                                abbrev_first_name=abbrev_first_name, show_title=show_title)