djon go .models не имеет атрибута 'ArrayModelField' - PullRequest
0 голосов
/ 26 мая 2020

Привет, я использую djon go для подключения моего приложения Django к MongoDB, и я следую документации djon go: https://djongo.readthedocs.io/docs/array-model-field/

Я хочу добавить ArrayModelField в мои модели:

20 class succesfull_injections(models.Model):
 21     sqli = models.CharField(max_length=100)
 22     
 23     class Meta: 
 24         abstract = True
 25 
 26 class attack(models.Model):
 27     succesfullInjections = models.ArrayModelField(
 28             model_container = succesfull_injections,
 29             )
 30     successSQLI = models.CharField(max_length=100)
 31     time = models.CharField(max_length = 100)
 32     triedInjections = models.CharField(max_length = 100)

Но когда я выполняю миграцию или makemigrations, отображается следующая ошибка:

Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/home/jagl/.virtualenvs/django-getting-started/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/jagl/.virtualenvs/django-getting-started/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/home/jagl/.virtualenvs/django-getting-started/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/jagl/.virtualenvs/django-getting-started/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/home/jagl/.virtualenvs/django-getting-started/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/jagl/Documents/Learning/Programming/Django/django-getting-started/meeting_planner/reports/models.py", line 27, in <module>
    class attack(models.Model):
  File "/home/jagl/Documents/Learning/Programming/Django/django-getting-started/meeting_planner/reports/models.py", line 28, in attack
    succesfullInjections = models.ArrayModelField(
AttributeError: module 'djongo.models' has no attribute 'ArrayModelField'

Я использую: Django == 2.2.12 djongo = = 1.3.2

...