Guest User

Untitled

a guest
Dec 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. Traceback (most recent call last):
  2. File "manage.py", line 22, in <module>
  3. execute_from_command_line(sys.argv)
  4. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagement__init__.py", line 381, in execute_from_command_line
  5. utility.execute()
  6. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagement__init__.py", line 375, in execute
  7. self.fetch_command(subcommand).run_from_argv(self.argv)
  8. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagementbase.py", line 316, in run_from_argv
  9. self.execute(*args, **cmd_options)
  10. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagementbase.py", line 353, in execute
  11. output = self.handle(*args, **options)
  12. File "C:PROJECTSleadshubtender_matching_enginemanagementcommandsscrap_etenders.py", line 8, in handle
  13. main()
  14. File "C:PROJECTSleadshubTender_Loaderetenders_scraper.py", line 52, in main
  15. save_tender_to_db(entry)
  16. File "C:PROJECTSleadshubTender_Loaderetenders_scraper.py", line 129, in save_tender_to_db
  17. description=container_tag[0]
  18. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsmanager.py", line 82, in manager_method
  19. return getattr(self.get_queryset(), name)(*args, **kwargs)
  20. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsquery.py", line 413, in create
  21. obj.save(force_insert=True, using=self.db)
  22. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 718, in save
  23. force_update=force_update, update_fields=update_fields)
  24. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 748, in save_base
  25. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  26. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 831, in _save_table
  27. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  28. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 869, in _do_insert
  29. using=using, raw=raw)
  30. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsmanager.py", line 82, in manager_method
  31. return getattr(self.get_queryset(), name)(*args, **kwargs)
  32. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsquery.py", line 1136, in _insert
  33. return query.get_compiler(using=using).execute_sql(return_id)
  34. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1288, in execute_sql
  35. for sql, params in self.as_sql():
  36. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1241, in as_sql
  37. for obj in self.query.objs
  38. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1241, in <listcomp>
  39. for obj in self.query.objs
  40. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1240, in <listcomp>
  41. [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
  42. File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1168, in prepare_value
  43. value = value.resolve_expression(self.query, allow_joins=False, for_save=True)
  44. TypeError: 'NoneType' object is not callable
  45.  
  46. #This is the model that stores the tender.
  47. class Tender(models.Model):
  48. tenderCategory = models.ManyToManyField(Category, blank=False) #this field holds the tender category, e.g. construction, engineering, human resources etc.
  49. tenderProvince = models.ManyToManyField(Province, blank=False) #this is the province the tender was advertised from.
  50. buyersName = models.CharField(max_length=100) #this is the name of the Buyer e.g. Dept. of Transport, Transnet, Dept of Agriculture etc.
  51. summary = models.TextField(blank=False) #this is the tender title as per the Buyer.
  52. refNum = models.CharField(max_length=100) #tender ref number as per the Buyer.
  53. issueDate = models.DateTimeField(blank=True, null=True) #date the tender was published
  54. closingDate = models.DateTimeField(default=timezone.now, blank=True, null=True) #tender closing date
  55. siteInspectionDate = models.DateTimeField(blank=True, null=True)
  56. siteInspection = RichTextField(blank=True, null=True) #site inspection date, if any
  57. enquiries = RichTextField(blank=True, null=True) #this field stores details of the contact person, for the tender.
  58. description = RichTextField(blank=True, null=True) #this is the body of the tender. the tender details are captured here.
  59. assigned_keywords = models.ManyToManyField(Keywords, blank=True)
  60. matched = models.BooleanField(default=False, blank=False)
  61. capture_date = models.DateField(default=timezone.now, blank=False, null=False)
  62. date_assigned = models.DateField(blank=True, null=True)
  63. tDocLinks = RichTextField(blank=True)
  64.  
  65. def check_if_expired(self):
  66. if self.closingDate < timezone.now():
  67. return True
  68. else:
  69. return False
  70.  
  71. class Meta:
  72. ordering = ['-closingDate']
  73.  
  74. # tenderCategory=Category.objects.get(pk=1),
  75. # tenderProvince=Province.objects.get(pk=1),
Add Comment
Please, Sign In to add comment