Beispiel #1
0
 def _getAnswer(self):
     event_persons = []
     users = searchUsers(self._surName, self._name, self._organisation,
                         self._email, self._exactMatch, self._searchExt)
     if self._event:
         fields = {
             EventPerson.first_name: self._name,
             EventPerson.last_name: self._surName,
             EventPerson.email: self._email,
             EventPerson.affiliation: self._organisation
         }
         criteria = [
             unaccent_match(col, val, exact=self._exactMatch)
             for col, val in fields.iteritems()
         ]
         event_persons = self._event.persons.filter(*criteria).all()
     fossilized_users = fossilize(
         sorted(users,
                key=lambda av: (av.getStraightFullName(), av.getEmail())))
     fossilized_event_persons = map(serialize_event_person, event_persons)
     unique_users = {
         to_unicode(user['email']): user
         for user in chain(fossilized_users, fossilized_event_persons)
     }
     return sorted(unique_users.values(),
                   key=lambda x:
                   (to_unicode(x['name']).lower(), to_unicode(x['email'])))
Beispiel #2
0
    def _getAnswer(self):
        results = {}
        users = search.searchUsers(
            surName=self._params.get("surName", ""),
            name=self._params.get("name", ""),
            organisation=self._params.get("organisation", ""),
            email=self._params.get("email", ""),
            conferenceId=self._params.get("conferenceId", None),
            exactMatch=self._params.get("exactMatch", False),
            searchExt=self._params.get("searchExt", False))

        groups = search.searchGroups(group=self._params.get("group", ""),
                                     searchExt=self._params.get(
                                         "searchExt", False))

        fossilizedUsers = [human.fossilize(IAvatarFossil) for human in users]
        fossilizedGroups = [group.fossilize(IGroupFossil) for group in groups]

        fossilizedUsers.sort(cmp=UserComparator.cmpUsers)
        fossilizedGroups.sort(cmp=UserComparator.cmpGroups)

        results["people"] = fossilizedUsers
        results["groups"] = fossilizedGroups

        return results
Beispiel #3
0
    def _getAnswer(self):

        results = search.searchUsers(self._surName, self._name, self._organisation, self._email,
                                     self._confId, self._exactMatch, self._searchExt)

        # will use either IAvatarFossil or IContributionParticipationFossil
        fossilizedResults = fossilize(sorted(results, key=lambda av: (av.getStraightFullName(), av.getEmail())))

        return fossilizedResults
Beispiel #4
0
    def _getAnswer(self):

        results = search.searchUsers(self._surName, self._name, self._organisation, self._email,
                                     self._confId, self._exactMatch, self._searchExt)

        #will use either IAvatarFossil or IContributionParticipationFossil
        fossilizedResults = fossilize(results)
        fossilizedResults.sort(cmp=UserComparator.cmpUsers)

        return fossilizedResults
Beispiel #5
0
    def _getAnswer(self):

        results = search.searchUsers(self._surName, self._name,
                                     self._organisation, self._email,
                                     self._confId, self._exactMatch,
                                     self._searchExt)

        #will use either IAvatarFossil or IContributionParticipationFossil
        fossilizedResults = fossilize(results)
        fossilizedResults.sort(cmp=UserComparator.cmpUsers)

        return fossilizedResults
Beispiel #6
0
    def _getAnswer(self):

        results = search.searchUsers(self._surName, self._name,
                                     self._organisation, self._email,
                                     self._confId, self._exactMatch,
                                     self._searchExt)

        # will use either IAvatarFossil or IContributionParticipationFossil
        fossilizedResults = fossilize(
            sorted(results,
                   key=lambda av: (av.getStraightFullName(), av.getEmail())))

        return fossilizedResults
Beispiel #7
0
 def _getAnswer(self):
     event_persons = []
     users = searchUsers(self._surName, self._name, self._organisation, self._email,
                         self._exactMatch, self._searchExt)
     if self._event:
         fields = {EventPerson.first_name: self._name,
                   EventPerson.last_name: self._surName,
                   EventPerson.email: self._email,
                   EventPerson.affiliation: self._organisation}
         criteria = [unaccent_match(col, val, exact=self._exactMatch) for col, val in fields.iteritems()]
         event_persons = self._event.persons.filter(*criteria).all()
     fossilized_users = fossilize(sorted(users, key=lambda av: (av.getStraightFullName(), av.getEmail())))
     fossilized_event_persons = map(serialize_event_person, event_persons)
     unique_users = {to_unicode(user['email']): user for user in chain(fossilized_users, fossilized_event_persons)}
     return sorted(unique_users.values(), key=lambda x: (to_unicode(x['name']).lower(), to_unicode(x['email'])))
Beispiel #8
0
    def _getAnswer(self):
        results = {}
        users = search.searchUsers(surName = self._params.get("surName", ""),
                               name = self._params.get("name", ""),
                               organisation = self._params.get("organisation", ""),
                               email = self._params.get("email", ""),
                               conferenceId = self._params.get("conferenceId", None),
                               exactMatch = self._params.get("exactMatch", False),
                               searchExt = self._params.get("searchExt", False))

        groups = search.searchGroups(group = self._params.get("group", ""),
                               searchExt = self._params.get("searchExt", False))

        fossilizedUsers = [human.fossilize(IAvatarFossil) for human in users]
        fossilizedGroups = [group.fossilize(IGroupFossil) for group in groups]

        fossilizedUsers.sort(cmp=UserComparator.cmpUsers)
        fossilizedGroups.sort(cmp=UserComparator.cmpGroups)

        results["people"] = fossilizedUsers
        results["groups"] = fossilizedGroups

        return results