omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Getting people from a group in contacts api

    Pythonista
    2
    3
    1599
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wjshea
      wjshea last edited by

      Hi, I’m trying to get a list of people from a group.

      def test_get_contacts_from_group_name():
      	groupName = "Mail List Test"
      	
      	groups = contacts.get_all_groups()
      	for group in groups:
      		if (groupName == group.name):
      			members_group = contacts.get_group(group.id)
      			print(members_group)
      			members_group.get_all_people()
      			#for member in members_group:
      			#	print (member.address)
      			
      		else:
      			print('-1')	
      
      

      Group does not have a member called get_all_members. Are there away to get members from a group?

      Thanks

      1 Reply Last reply Reply Quote 0
      • wjshea
        wjshea last edited by

        I figured it out...

        There is a method on group called get_all_members. I must have missed in when reviewing the docs.

        Phuket2 1 Reply Last reply Reply Quote 0
        • Phuket2
          Phuket2 @wjshea last edited by

          @wjshea, i was doing something with contacts yesterday. I found just doing print(help(contacts)) was very useful.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors