Skip to content

AttributeError: type object [...] has no attribute '_meta' #90

@lorenzog

Description

@lorenzog

Expected Behavior (Mandatory)

Running python manage.py install_labels returns no error.

Actual Behavior (Mandatory)

When following the tutorial, if a model is registered in admin.py using

from django_neomodel import admin as neo_admin 
from .models import MyModel
[...]
neo_admin.register(MyModel, MyModelAdmin)

The following error is returned:

File "/[...]/venv/lib/python3.11/site-packages/django/contrib/admin/sites.py", line 118, in register
    if model._meta.abstract:
       ^^^^^^^^^^^
AttributeError: type object 'MyModel' has no attribute '_meta'

I fixed it by following the next step of the tutorial, i.e.:

from django_neomodel import DjangoNode

class MyModel(DjangoNode):
    [...]
    class Meta:
        app_label = "myapp"

How to Reproduce the Problem

Follow the tutorial.

Specifications (Mandatory)

Currently used versions:
django_neomodel 0.1.1

Versions

  • OS: Debian 12
  • Neo4j: 5.11.0 (Docker)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions