This example is very helpful. Thanks! --Steve
On Wednesday, September 11, 2013 11:43:11 AM UTC-7, Steven MacLeod wrote: > > Yes, this can be done using the API. Assuming you have rbtools 5.x > installed, the following script should work. Modify for your desired > output. It should be noted that this will make a large number of HTTP > requests, and is not optimized. > > from rbtools.api.client import RBClient > > client = RBClient("http://<your-rb-server-here>") > root = client.get_root() > > groups = root.get_groups() > > while True: > for group in groups: > print group.name > users = group.get_users() > > while True: > for user in users: > print "\t%s" % user.username > > try: > users = users.get_next() > except StopIteration: > break > > try: > groups = groups.get_next() > except StopIteration: > break > > > On Wed, Sep 11, 2013 at 12:46 PM, Steve <seide...@gmail.com > <javascript:>>wrote: > >> Better yet, is there a way to do this with the new RBTools 5.x API? >> >> --Steve >> >> >> On Wednesday, September 11, 2013 8:54:07 AM UTC-7, Steve wrote: >>> >>> I can list all RB users this way: >>> >>> >>> from django.contrib.auth.models import User >>> >>> for user in User.objects.all(): >>> >>> print user >>> >>> That correctly prints out all of my users. But the same doesn't work for >>> Group >>> >>> >>> from django.contrib.auth.models import Group >>> >>> for group in Group.objects.all(): >>> >>> print group >>> default reviewer >>> >>> I have about 30 groups defined in RB, but I only get 'default reviewer'. >>> What I'd like to do is list out all the groups, or more specifically, for >>> each group, list all the user in the group. There's probably a set of >>> django functions that will do that, but I'm having trouble finding them. >>> Can someone point me in the right direction? >>> >>> Thanks >>> >>> --Steve >>> >>> -- >> Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/ >> --- >> Sign up for Review Board hosting at RBCommons: https://rbcommons.com/ >> --- >> Happy user? Let us know at http://www.reviewboard.org/users/ >> --- >> You received this message because you are subscribed to the Google Groups >> "reviewboard" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to reviewboard...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/ --- Sign up for Review Board hosting at RBCommons: https://rbcommons.com/ --- Happy user? Let us know at http://www.reviewboard.org/users/ --- You received this message because you are subscribed to the Google Groups "reviewboard" group. To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.