Re: Totals / Reports?

2010-01-05 Thread grimbeaver
That worked.  I wanted the total number of review requests, not the
number of reviews.  Perhaps that could be added as a column some day
to the groups page.

On Jan 5, 2:21 pm, Christian Hammond  wrote:
> On Tue, Jan 5, 2010 at 10:04 AM, Chris Clark  wrote:
> > grimbeaver wrote:
>
> >> I need a simple way to get the total number of reviews in a group.
> >> We've assigned all the code reviews into groups based on project.
> >> Project management has to report the total number of code reviews
> >> completed for a project to our partner.  When you look at the group
> >> view it only gives you a count of the pending reviews, no total
> >> count.  Obviously in an ideal world there will be better reports some
> >> day, but for now I just need an easy way to get this number when
> >> needed.
>
> > Off the top of my head there are 2 options:
>
> >  1. use the Django manage shell and write simple Python queries
> >  2. access the database directly, e.g. using native sql terminal
> >     monitor tools and query the table(s) directly
>
> > I don't have queries for these but it probably wouldn't take long by poking
> > around. The Django tutorials are pretty good if you want to try option #1
> > which requires basic Python skills. Option #2 requires basic SQL skills.
>
> > If you create useful scripts they would be good to post back to the mailing
> > list.
>
> > Chris
>
> Yeah, these options are necessary for now.
>
> Is it the total number of reviews, or review requests?
>
> To get into the Python shell for Review Board, run:
>
>     $ rb-site manage /path/to/site shell
>
> Then:
>
>    >>> from django.db.models import Count
>    >>> from reviewboard.reviews.models import ReviewRequest
>    >>>
>    >>> # Total number of public review requests to a group (pending and
> closed)
>    >>> review_requests = ReviewRequest.objects.to_group("yourgroupname",
> status=None)
>    >>> print review_requests.count()
>    >>>
>    >>> # Total number of public reviews to all review requests in a group
>    >>> print
> review_requests.filter(reviews__public=True).aggregate(Count("reviews"))['r 
> eviews__count']
>
> I think that should work off-hand. Let me know if there are problems with
> it.
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com
-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Re: Totals / Reports?

2010-01-05 Thread Christian Hammond
On Tue, Jan 5, 2010 at 10:04 AM, Chris Clark  wrote:

> grimbeaver wrote:
>
>> I need a simple way to get the total number of reviews in a group.
>> We've assigned all the code reviews into groups based on project.
>> Project management has to report the total number of code reviews
>> completed for a project to our partner.  When you look at the group
>> view it only gives you a count of the pending reviews, no total
>> count.  Obviously in an ideal world there will be better reports some
>> day, but for now I just need an easy way to get this number when
>> needed.
>>
>>
>
> Off the top of my head there are 2 options:
>
>  1. use the Django manage shell and write simple Python queries
>  2. access the database directly, e.g. using native sql terminal
> monitor tools and query the table(s) directly
>
> I don't have queries for these but it probably wouldn't take long by poking
> around. The Django tutorials are pretty good if you want to try option #1
> which requires basic Python skills. Option #2 requires basic SQL skills.
>
> If you create useful scripts they would be good to post back to the mailing
> list.
>
> Chris
>

Yeah, these options are necessary for now.

Is it the total number of reviews, or review requests?

To get into the Python shell for Review Board, run:

$ rb-site manage /path/to/site shell

Then:

   >>> from django.db.models import Count
   >>> from reviewboard.reviews.models import ReviewRequest
   >>>
   >>> # Total number of public review requests to a group (pending and
closed)
   >>> review_requests = ReviewRequest.objects.to_group("yourgroupname",
status=None)
   >>> print review_requests.count()
   >>>
   >>> # Total number of public reviews to all review requests in a group
   >>> print
review_requests.filter(reviews__public=True).aggregate(Count("reviews"))['reviews__count']

I think that should work off-hand. Let me know if there are problems with
it.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com
-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Re: Totals / Reports?

2010-01-05 Thread Chris Clark

grimbeaver wrote:

I need a simple way to get the total number of reviews in a group.
We've assigned all the code reviews into groups based on project.
Project management has to report the total number of code reviews
completed for a project to our partner.  When you look at the group
view it only gives you a count of the pending reviews, no total
count.  Obviously in an ideal world there will be better reports some
day, but for now I just need an easy way to get this number when
needed.
  


Off the top of my head there are 2 options:

  1. use the Django manage shell and write simple Python queries
  2. access the database directly, e.g. using native sql terminal
 monitor tools and query the table(s) directly

I don't have queries for these but it probably wouldn't take long by 
poking around. The Django tutorials are pretty good if you want to try 
option #1 which requires basic Python skills. Option #2 requires basic 
SQL skills.


If you create useful scripts they would be good to post back to the 
mailing list.


Chris

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en