'>' 'method'和'int'实例之间不支持

时间:2017-12-28 23:00:19

标签: python django django-models

所以我正在研究这个配对应用程序。

我的models.py中有一个类:

class PositionMatchManager(models.Manager):
def update_top_suggestions(self, user, match_int):
    matches = Match.objects.get_matches(user)[:match_int]
    for match in matches:
        job_set = match[0].userjob_set.all()
        if job_set.count > 0:
            for job in job_set:
                try:
                    the_job = Job.objects.get(text__iexact=job.position)
                    jobmatch, created = self.get_or_create(user=user, job=the_job)
                except:
                    pass
                try:
                    the_loc = Location.objects.get(name__iexact=job.location)
                    locmatch, created = LocationMatch.objects.get_or_create(user=user, location=the_loc)
                except:
                    pass
                try:
                    the_employer = Employer.objects.get(name__iexact=job.employer_name)
                    empymatch, created = EmployerMatch.objects.get_or_create(user=user, employer=the_employer)
                except:
                    pass

当我运行我的服务器时,我收到一条错误消息说     / accounts / login /的TypeError '>' 'method'和'int'

的实例之间不支持

0 个答案:

没有答案