Esempio n. 1
0
    def get(self, request):
        user = self.request.user
        tag_dict = SaveResumeTag.get_search_tag_dict(user, self.resume)
        search_tag = SaveResumeTag.get_search_tag(tag_dict, self.resume)

        today = get_today()
        min_reco_time = today + datetime.timedelta(days=-9)
        has_reco_jobs = RecommendJob.objects.filter(
            user=user,
            delete=False,
            read_status='unread',
            action='',
            display=True,
            search_tag=search_tag,
            reco_index__gt=0,
            reco_time__gt=min_reco_time,
        ).exclude(
            job__company__key_points='',
        )
        if not has_reco_jobs:
            SaveResumeTag.send_reco_task(tag_dict, search_tag)

        return render(
            request,
            self.template,
            {}
        )
Esempio n. 2
0
 def get_recommend_jobs(self, search_tag):
     user = self.request.user
     today = get_today()
     min_reco_time = today + datetime.timedelta(days=-9)
     recommend_jobs = self.model.objects.prefetch_related(
         'job__company__category',
     ).filter(
         user=user,
         delete=False,
         read_status='unread',
         action='',
         display=True,
         search_tag=search_tag,
         reco_index__gt=0,
         reco_time__gt=min_reco_time,
     ).exclude(
         job__company__key_points='',
     ).select_related(
         'job',
         'job__company',
     ).order_by(
         '-search_tag',
         '-reco_index',
         '-reco_time',
     ).values(
         'id',
         'job__expect_area',
         'job__job_desc',
         'job__deleted',
         'job__id',
         'succ_rate',
         'job__title',
         'job__salary_min',
         'job__salary_max',
         'job__work_years_min',
         'job__work_years_max',
         'job__degree',
         'job__job_desc',
         'job__skill_required',
         'job__company__company_name',
         'job__company__key_points',
         'job__company__desc',
         'job__company__pinbot_recommend',
         'job__company__key_points',
         'job__company__favour_count',
         'job__company__id',
         'job__company__company_stage',
         'job__company__url',
         'job__company__product_url',
         'job__company__category',
         'job__job_welfare',
     )
     return recommend_jobs
Esempio n. 3
0
 def get_expire_time(self):
     if self.EXPIRE_TIME:
         return self.EXPIRE_TIME
     expire_time = (get_tomorrow() - get_today()).total_seconds()
     return expire_time
Esempio n. 4
0
 def init_date(self):
     self.YESTERDAY = get_yesterday()
     self.TODAY = get_today()
     return self.YESTERDAY, self.TODAY
Esempio n. 5
0
 def init_date(self):
     today = get_today()
     self.start_date = today - datetime.timedelta(days=today.weekday() + 7)
     self.end_date = self.start_date + datetime.timedelta(days=7)
     return self.start_date, self.end_date