예제 #1
0
    def get_data(self):
        data = super().get_data()
        user_wrapper = UserWrapper(user=self.applicant.user)
        answers = [
            {
                'question': answer.question.title,
                'response': answer.response,
                'response_text': answer.response_text
            }
            for answer in self.applicant.answers.all()
        ]

        data.update({
            'applicant_profile_picture': user_wrapper.get_profile_picture(settings.LARGE_IMAGE_SIZE),
            'applicant_name': user_wrapper.get_full_name(),
            'applicant_role': user_wrapper.user_title,
            'summary': self.applicant.summary,
            'questions_extra_info': self.applicant.questions_extra_info,
            'applicant_email': user_wrapper.email,
            'applicant_profile_url': user_wrapper.profile_url,
            'public_url': self.opportunity.admin_url_public,
            'answers': answers,
            'reply_to': [
                user_wrapper.email,
            ],

        })
        return data
예제 #2
0
 def get_data(self):
     data = super().get_data()
     user_wrapper = UserWrapper(user=self.opportunity.created_by)
     data.update({
         'created_by_profile_picture':
         user_wrapper.get_profile_picture(settings.LARGE_IMAGE_SIZE),
         'created_by_name':
         user_wrapper.full_name,
         'created_by_role':
         user_wrapper.user_title,
         'public_url':
         self.opportunity.url_public,
         'budget_string':
         self.opportunity.budget_string,
         'num_positions':
         self.opportunity.num_positions,
         'description':
         self.opportunity.description,
         'entity_name':
         self.opportunity.entity,
         'location_string':
         self.opportunity.location_string,
         'start_date':
         self.opportunity.start_date.strftime('%d %b, %Y')
         if self.opportunity.start_date else '',
         'duration':
         self.opportunity.duration,
         'tags':
         list(self.opportunity.keywords.all().values_list('name',
                                                          flat=True)),
         'reply_to': [
             user_wrapper.email,
         ],
     })
     return data
예제 #3
0
    def get_data(self):
        user_wrapper = UserWrapper(user=self.opportunity.created_by)

        return {
            'title': self.opportunity.title,
            'created_by_profile_picture': user_wrapper.get_profile_picture(settings.MEDIUM_IMAGE_SIZE),
            'created_by_name': user_wrapper.get_full_name(),
            'created_by_role': user_wrapper.user_title,
            'role': self.opportunity.role_string,
            'category_code': self.opportunity.category.code,
        }
예제 #4
0
    def get_data(self):
        user_wrapper = UserWrapper(user=self.opportunity.created_by)

        return {
            'title':
            self.opportunity.title,
            'created_by_profile_picture':
            user_wrapper.get_profile_picture(settings.MEDIUM_IMAGE_SIZE),
            'created_by_name':
            user_wrapper.get_full_name(),
            'created_by_user_title':
            user_wrapper.user_title,
            'recipient_name':
            self.user_recipient.get('full_name'),
            'public_url':
            self.opportunity.url_public,
            'role':
            self.opportunity.role_string,
            'disable_notification_url':
            self.user_recipient.get('disable_notification_url'),
        }