Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback (most recent call last):
- File "manage.py", line 22, in <module>
- execute_from_command_line(sys.argv)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagement__init__.py", line 381, in execute_from_command_line
- utility.execute()
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagement__init__.py", line 375, in execute
- self.fetch_command(subcommand).run_from_argv(self.argv)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagementbase.py", line 316, in run_from_argv
- self.execute(*args, **cmd_options)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangocoremanagementbase.py", line 353, in execute
- output = self.handle(*args, **options)
- File "C:PROJECTSleadshubtender_matching_enginemanagementcommandsscrap_etenders.py", line 8, in handle
- main()
- File "C:PROJECTSleadshubTender_Loaderetenders_scraper.py", line 52, in main
- save_tender_to_db(entry)
- File "C:PROJECTSleadshubTender_Loaderetenders_scraper.py", line 129, in save_tender_to_db
- description=container_tag[0]
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsmanager.py", line 82, in manager_method
- return getattr(self.get_queryset(), name)(*args, **kwargs)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsquery.py", line 413, in create
- obj.save(force_insert=True, using=self.db)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 718, in save
- force_update=force_update, update_fields=update_fields)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 748, in save_base
- updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 831, in _save_table
- result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsbase.py", line 869, in _do_insert
- using=using, raw=raw)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsmanager.py", line 82, in manager_method
- return getattr(self.get_queryset(), name)(*args, **kwargs)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsquery.py", line 1136, in _insert
- return query.get_compiler(using=using).execute_sql(return_id)
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1288, in execute_sql
- for sql, params in self.as_sql():
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1241, in as_sql
- for obj in self.query.objs
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1241, in <listcomp>
- for obj in self.query.objs
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1240, in <listcomp>
- [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
- File "C:UsersACERAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelssqlcompiler.py", line 1168, in prepare_value
- value = value.resolve_expression(self.query, allow_joins=False, for_save=True)
- TypeError: 'NoneType' object is not callable
- #This is the model that stores the tender.
- class Tender(models.Model):
- tenderCategory = models.ManyToManyField(Category, blank=False) #this field holds the tender category, e.g. construction, engineering, human resources etc.
- tenderProvince = models.ManyToManyField(Province, blank=False) #this is the province the tender was advertised from.
- buyersName = models.CharField(max_length=100) #this is the name of the Buyer e.g. Dept. of Transport, Transnet, Dept of Agriculture etc.
- summary = models.TextField(blank=False) #this is the tender title as per the Buyer.
- refNum = models.CharField(max_length=100) #tender ref number as per the Buyer.
- issueDate = models.DateTimeField(blank=True, null=True) #date the tender was published
- closingDate = models.DateTimeField(default=timezone.now, blank=True, null=True) #tender closing date
- siteInspectionDate = models.DateTimeField(blank=True, null=True)
- siteInspection = RichTextField(blank=True, null=True) #site inspection date, if any
- enquiries = RichTextField(blank=True, null=True) #this field stores details of the contact person, for the tender.
- description = RichTextField(blank=True, null=True) #this is the body of the tender. the tender details are captured here.
- assigned_keywords = models.ManyToManyField(Keywords, blank=True)
- matched = models.BooleanField(default=False, blank=False)
- capture_date = models.DateField(default=timezone.now, blank=False, null=False)
- date_assigned = models.DateField(blank=True, null=True)
- tDocLinks = RichTextField(blank=True)
- def check_if_expired(self):
- if self.closingDate < timezone.now():
- return True
- else:
- return False
- class Meta:
- ordering = ['-closingDate']
- # tenderCategory=Category.objects.get(pk=1),
- # tenderProvince=Province.objects.get(pk=1),
Add Comment
Please, Sign In to add comment