scholrly / neo4django

Drop-in Neo4j/Django integration.
GNU General Public License v3.0
357 stars 83 forks source link

Model Inheritance and Admin Interface #240

Open meatballs opened 10 years ago

meatballs commented 10 years ago

I have a problem with inheritance and the admin interface. Using the following simple inheritance structure, the 'name' field does not appear in the admin screens.

Using the same structure with django.db instead of neo4djang.db works fine.

Moving the name field into the Child class also works fine.

This is on django 1.5.5 and the github repo version of neo4django.

models.py:

from neo4django.db import models

class Parent(models.NodeModel):
    name = models.StringProperty()

    class Meta:
        abstract = True

class Child(Parent):
    pass

admin.py:

from neo4django import admin
from core.models import Child

class ChildAdmin(admin.ModelAdmin):
    pass

admin.site.register(Child, ChildAdmin)
meatballs commented 10 years ago

This issue was originally a question on Stackoverflow: http://stackoverflow.com/questions/21909589/using-abstract-base-class-in-django-admin-interface-with-neo4django/21910481