我有一个Model
用.django
neo4django
class Person(models.NodeModel):
"""
Persons of a Company
"""
email = models.EmailProperty(required=True, unique=True, indexed=True,
name=_(u'email'),
verbose_name=_(u'person email address'),
help_text=_(u'bla bla bla some help text'))
full_name = models.StringProperty(name=_(u'Person full name'))
# Neo4J Relationships
role = models.Relationship(Role, rel_type='has_role',
direction='Outgoing',
related_name='persons')
company = models.Relationship(Company, rel_type='works_to',
direction='Outgoing',
related_name='employees')
我尝试使用 django shell
>>> p = Person.objects.create(email=u'email@company.com')
>>> p.id
6
>>> Person.objects.get(id='6')
<Person: Person object>
>>> Person.objects.get(email=u'email@company.com')
Traceback [bla bla bla]
[...]
DoesNotExist: Person matching query does not exist.
>>>
我还检查了Neo4J
Web 界面,我看到了创建的节点,但没有任何属性!
这个问题看起来像这里提到的问题,但我不确定这是否是同一个问题。
我有Django 1.4.5
和Neo4J 1.8.2