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

readme improvement - dj_admin #71

Open
segfaultDelirium opened this issue Feb 17, 2022 · 1 comment
Open

readme improvement - dj_admin #71

segfaultDelirium opened this issue Feb 17, 2022 · 1 comment

Comments

@segfaultDelirium
Copy link

Hello, could you specify what do you mean by dj_admin.ModelAdmin in below readme snippet? What is dj_admin? It's not installed when installing django_neomodel package nor Django. How can I get it? Please help as I honestly don't know.

dj_admin

from django_neomodel import admin as neo_admin
from .models import Book

class BookAdmin(dj_admin.ModelAdmin):
list_display = ("title", "created")
neo_admin.register(Book, BookAdmin)

@raratiru
Copy link

It is the original admin:

from django.contrib import admin as dj_admin
from django_neomodel import admin as neo_admin
from .models import Library, Book, Shelf

However, it is necessary for your model to inherit from DjangoNode and include an app_label attribute to work:

class Shelf(DjangoNode):
uid = UniqueIdProperty(primary_key=True)
name = StringProperty()
class Meta:
app_label = "someapp"
def __str__(self):
return self.name

Is this project dead? Do I wonder...

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

2 participants