создаю management команду, но django не видит object и выдает вот такую ошибку. Как можно это исправить?
Traceback (most recent call last):
File "D:\Program\project\FFStateWeb\FFState\backend\manage.py", line 22, in
main()
File "D:\Program\project\FFStateWeb\FFState\backend\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "D:\Program\project\FFStateWeb\venv\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
utility.execute()
File "D:\Program\project\FFStateWeb\venv\lib\site-packages\django\core\management\__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\Program\project\FFStateWeb\venv\lib\site-packages\django\core\management\base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "D:\Program\project\FFStateWeb\venv\lib\site-packages\django\core\management\base.py", line 460, in execute
output = self.handle(*args, **options)
File "D:\Program\project\FFStateWeb\FFState\backend\api\management\commands\updatedata.py", line 22, in handle
serializer = News.object.create(
AttributeError: type object 'News' has no attribute 'object'. Did you mean: 'objects'?
вот код в котором он выдает эту ошибку:
from django.core.management.base import BaseCommand
import datetime
from ...models import News
class Command(BaseCommand):
def handle(self, *args, **options):
...
serializer = News.object.create(
id_news=index,
agency=agency,
head=head,
link=link,
text=text,
pubdate=pubdate,
time_now=timenow,
)
serializer.save()