当前位置: 首页>>代码示例>>Python>>正文


Python Group.id方法代码示例

本文整理汇总了Python中group.Group.id方法的典型用法代码示例。如果您正苦于以下问题:Python Group.id方法的具体用法?Python Group.id怎么用?Python Group.id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在group.Group的用法示例。


在下文中一共展示了Group.id方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: group

# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import id [as 别名]
    def group(self):
        """

        :return: Group() that is attached to this meeting
        """
        meeting_group_relationship = self._graph_db.match(start_node=None,
                                                         rel_type=GraphRelationship.HAS_MEETING,
                                                         end_node=self.meeting_node)
        group = Group()
        for rel in meeting_group_relationship:
            group.id = rel.end_node.properties['id']
            group.get_group()
        return group
开发者ID:julianpistorius,项目名称:back-end-api,代码行数:15,代码来源:meeting.py

示例2: leave_group

# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import id [as 别名]
    def leave_group(self, group_id):
        """
        remove relationship between user and study group
        :param group_id: string uuid
        :return: None
        """
        #TODO exception handling
        group = Group()
        group.id = group_id
        user_group_relationship = self._graph_db.match_one(start_node=self.user_node,
                                                          rel_type=GraphRelationship.MEMBER_OF,
                                                          end_node=group.group_node)

        self._graph_db.delete(user_group_relationship)
开发者ID:julianpistorius,项目名称:back-end-api,代码行数:16,代码来源:user.py

示例3: user_groups

# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import id [as 别名]
    def user_groups(self):
        """

        :return: list of tuples of the groups
        """
        #TODO add list of related interests
        user_groups = self._graph_db.match(start_node=self.user_node, rel_type=GraphRelationship.STUDIES_WITH,
                                          end_node=None)
        # create a list of tuples of interests and the users's relationship to them
        groups_list = []
        for rel in user_groups:
            group_properties = dict(rel.end_node.properties)
            group = Group()
            group.id = group_properties['id']
            interests = group.group_interests
            group_interests_list = []
            for interest in interests:
                group_interests_list.append(interest['name'])
            group_properties['interests'] = group_interests_list
            groups_list.append(group_properties)
        return groups_list
开发者ID:julianpistorius,项目名称:back-end-api,代码行数:23,代码来源:user.py

示例4: join_group

# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import id [as 别名]
 def join_group(self, group_id, group_relationship_properties=None):
     """
     Add user as member of group
     :param group_id: string uuid
     :return:
     """
     #TODO exception handling
     group = Group()
     group.id = group_id
     # relationship properties
     join_properties = {
         'join_date': datetime.date.today()
     }
     user_group_relationship = Relationship(self.user_node,
                                            GraphRelationship.STUDIES_WITH,
                                            group.group_node)
                                            # properties=join_properties)
     for key, value in join_properties.iteritems():
         user_group_relationship[key] = value
     try:
         self._graph_db.create_unique(user_group_relationship)
     except:
         pass
开发者ID:julianpistorius,项目名称:back-end-api,代码行数:25,代码来源:user.py

示例5: create_meeting

# 需要导入模块: from group import Group [as 别名]
# 或者: from group.Group import id [as 别名]
    def create_meeting(self, group_id, meeting_properties=None):
        """

        :param meeting_properties:
        :return:
        """
        #TODO exception handling
        self.created_date = datetime.date.today()
        self.id = str(uuid.uuid4())
        if meeting_properties is not None:
            self.set_meeting_properties(meeting_properties)
        new_meeting_node = Node.cast(GraphLabel.MEETING, self.meeting_properties)
        try:
            self._graph_db.create(new_meeting_node)
            group = Group()
            group.id = group_id
            group_node = group.group_node
            meeting_group_relationship = Relationship(group_node,
                                                     GraphRelationship.HAS_MEETING,
                                                     self.meeting_node)
            self._graph_db.create_unique(meeting_group_relationship)
        except:
            pass
        return new_meeting_node
开发者ID:julianpistorius,项目名称:back-end-api,代码行数:26,代码来源:meeting.py


注:本文中的group.Group.id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。