Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lorenzog opened this issue Sep 11, 2023 · 0 comments
Open

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

lorenzog opened this issue Sep 11, 2023 · 0 comments

Comments

@lorenzog
Copy link

lorenzog commented Sep 11, 2023

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant