I am getting AttributeError: type object 'Person' has no attribute '_meta' when trying to use Neomodel with Django's ModelForm. I'm new to using neomodel and do not know if Neomodel supports modelforms, but I've searched the docs and here for references without luck.
First Question, therefore is: does Neomodel support modelforms?
Second Question (if answer is yes to first): What is wrong with the following?
Models.py
from neomodel import (StructuredNode, StringProperty, IntegerProperty, RelationshipTo)
class Person (StructuredNode):
#Properties
email = StringProperty(unique_index=True, required=True)
name = StringProperty(unique_index=False, required=True)
and my forms.py:
from django.forms import ModelForm
from .models import Person
class AddPersonForm(ModelForm):
class Meta:
model = Person
fields = ['email','name']
In testing this at the django shell I get the following:
from devsite_neo.forms import AddPerson
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Dev\www\repos\devsite\devsite_neo\forms.py", line 7, in <module>
class AddPerson(ModelForm):
File "c:\Dev\www\venv\djangoenv\lib\site-packages\django\forms\models.py", line 284, in __new__
opts.help_texts, opts.error_messages)
File "c:\Dev\www\venv\djangoenv\lib\site-packages\django\forms\models.py", line 184, in fields_for_model
opts = model._meta
AttributeError: type object 'Person' has no attribute '_meta'
I'm using Python 3.4.2, Django 1.7.7 and neomodel 1.0.2
Thanks!