Пример #1
0
 def save(self, *args, **kwargs):
     logger.warn('Save camp')
     is_new = False
     if not self.id:
         is_new = True
     super(Campaign, self).save(*args, **kwargs)
     if is_new:
         index = graph_db.get_index(Node, self.nodes_index_name)
         node = index.create('id', str(self.id), {'campaign_id': self.id})
         logger.warn(node)
Пример #2
0
 def save(self, *args, **kwargs):
     logger.warn('Save camp')
     is_new = False
     if not self.id:
         is_new = True
     super(Campaign, self).save(*args, **kwargs)
     if is_new:
         index = graph_db.get_index(Node, self.nodes_index_name)
         node = index.create('id', str(self.id), {'campaign_id': self.id})  
         logger.warn(node)   
Пример #3
0
 def get(self, id):
     index = graph_db.get_index(Node, Campaign.nodes_index_name)
     return index.get('id', str(id))[0]
Пример #4
0
 def get(self, id):
     index = graph_db.get_index(Node, Campaign.nodes_index_name)
     return index.get('id', str(id))[0]