- Shekar
from django.db import models
from py2neo import Graph
from py2neo.ext.ogm import Store
import datetime
graph = Graph()
store = Store(graph)
class Fruit(object):
FruitName = models.CharField(max_length=100)
cr_date = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ('FruitName',)
def __init__(self, FruitName=None, cr_date=None):
print ("Here in model")
self.FruitName = GlobalCategoryName
self.cr_date = cr_date or datetime.datetime.now()
store.save_unique("Fruit","FruitName",FruitName,self)
def __str__(self):
return self.FruitName
When I run this, an object gets created with attributes name and creation date but the object is not of type fruit. Wondering what I am doing wrong.
- Shekar--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nigel,
node1 = Node("FirstLabel", "SecondLabel",name="MyPythonNode2", neo4j_version="2.2")
resultNodes = graph.create(node1)
#Iterate Over Tuple and print all the values in the Tuple
for index in range(len(resultNodes)):
print("Created Node - ", index, ", ", resultNodes[index])
The above piece of code will create a Node with 2 Labels and 2 properties.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.