Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For NameStore ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body AugAssignAdd NameStore ListLoad Dict Str Str NameLoad Call NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Return Call NameLoad Dict Str Str Str Str Str Str Num NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str keyword NameLoad keyword Str keyword Str Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword Str keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword Str AugAssignAdd NameStore ListLoad Dict Str Str Str NameLoad Dict Str Str Str NameLoad Return Call NameLoad Dict Str Str Str Str Str Str Num NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Str Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Return Call NameLoad Dict Str Str Str Str NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad keyword Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str AttributeLoad NameLoad attr NameLoad Call NameLoad Str keyword TupleLoad AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore ListLoad Dict Str Str Str Call NameLoad keyword Call AttributeLoad AttributeLoad NameLoad attr attr Str Return Call NameLoad Dict Str Str Str Str NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Return Call NameLoad Dict Str Str Str AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad decorator_list decorator_list
N/A django.core.urlresolvers reverse django.utils.dateparse parse_datetime rest_framework.views APIView rest_framework.generics GenericAPIView rest_framework.response Response mixins ProviderMixin models Transaction Organization Plan utils datetime_or_now managers.metrics monthly_balances serializers OrganizationSerializer managers.metrics active_subscribers aggregate_monthly aggregate_monthly_transactions churn_subscribers BalancesAPIView N/A ProviderMixin APIView N/A N/A 
    Generate a table of revenue (rows) per months (columns).

    **Example request**:

    .. sourcecode:: http

        GET /api/metrics/cowork/balances

    **Example response**:

    .. sourcecode:: http

        {
            "title": "Balances"
            "scale": 0.01,
            "unit": "$",
            "table": [
                {
                    "key": "Income"
                    "values": [
                        ["2014-09-01T00:00:00Z", 0],
                        ["2014-10-01T00:00:00Z", 1532624],
                        ["2014-11-01T00:00:00Z", 2348340],
                        ["2014-12-01T00:00:00Z", 3244770],
                        ["2015-01-01T00:00:00Z", 5494221],
                        ["2015-02-01T00:00:00Z", 7214221],
                        ["2015-03-01T00:00:00Z", 8444221],
                        ["2015-04-01T00:00:00Z", 9784221],
                        ["2015-05-01T00:00:00Z", 12784221],
                        ["2015-06-01T00:00:00Z", 14562341],
                        ["2015-07-01T00:00:00Z", 16567341],
                        ["2015-08-01T00:00:00Z", 17893214],
                        ["2015-08-06T02:24:50.485Z", 221340]
                    ],
                },
                {
                    "key": "Backlog"
                    "values": [
                        ["2014-09-01T00:00:00Z", 1712624],
                        ["2014-10-01T00:00:00Z", 3698340],
                        ["2014-11-01T00:00:00Z", 7214770],
                        ["2014-12-01T00:00:00Z", 10494221],
                        ["2015-01-01T00:00:00Z", 14281970],
                        ["2015-02-01T00:00:00Z", 18762845],
                        ["2015-03-01T00:00:00Z", 24258765],
                        ["2015-04-01T00:00:00Z", 31937741],
                        ["2015-05-01T00:00:00Z", 43002401],
                        ["2015-06-01T00:00:00Z", 53331444],
                        ["2015-07-01T00:00:00Z", 64775621],
                        ["2015-08-01T00:00:00Z", 75050033],
                        ["2015-08-06T02:24:50.485Z", 89156321]
                    ],
                },
                {
                    "key": "Receivable"
                    "values": [
                        ["2014-09-01T00:00:00Z", 0],
                        ["2014-10-01T00:00:00Z", 0],
                        ["2014-11-01T00:00:00Z", 0],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 0],
                        ["2015-02-01T00:00:00Z", 0],
                        ["2015-03-01T00:00:00Z", 0],
                        ["2015-04-01T00:00:00Z", 0],
                        ["2015-05-01T00:00:00Z", 0],
                        ["2015-06-01T00:00:00Z", 0],
                        ["2015-07-01T00:00:00Z", 0],
                        ["2015-08-01T00:00:00Z", 0],
                        ["2015-08-06T02:24:50.485Z", 0]
                    ],
                }
            ]
        }
     get N/A N/A self request N/A args kwargs N/A N/A start_at N/A N/A N/A request GET get start_at None N/A start_at N/A N/A start_at N/A parse_datetime start_at N/A start_at N/A datetime_or_now start_at N/A ends_at N/A N/A N/A request GET get ends_at None N/A ends_at N/A N/A ends_at N/A parse_datetime ends_at N/A ends_at N/A datetime_or_now ends_at N/A result N/A N/A key N/A N/A Transaction INCOME N/A Transaction BACKLOG N/A Transaction RECEIVABLE N/A N/A result N/A N/A key values key N/A monthly_balances organization N/A self provider account key until ends_at N/A N/A Response N/A title unit scale table Balances $ 0.01 result N/A N/A RevenueMetricAPIView N/A ProviderMixin APIView N/A N/A 
    Produce The sales, payments and refunds over a period of time.

    **Example request**:

    .. sourcecode:: http

        GET /api/metrics/cowork/revenue

    **Example response**:

    .. sourcecode:: http

        {
            "title": "Amount"
            "scale": 0.01,
            "unit": "$",
            "table": [
                {
                    "key": "Total Sales",
                    "values": [
                        ["2014-10-01T00:00:00Z", 1985716],
                        ["2014-11-01T00:00:00Z", 3516430],
                        ["2014-12-01T00:00:00Z", 3279451],
                        ["2015-01-01T00:00:00Z", 3787749],
                        ["2015-02-01T00:00:00Z", 4480875],
                        ["2015-03-01T00:00:00Z", 5495920],
                        ["2015-04-01T00:00:00Z", 7678976],
                        ["2015-05-01T00:00:00Z", 11064660],
                        ["2015-06-01T00:00:00Z", 10329043],
                        ["2015-07-01T00:00:00Z", 11444177],
                        ["2015-08-01T00:00:00Z", 10274412],
                        ["2015-08-06T04:59:14.721Z", 14106288]
                    ]
                },
                {
                    "key": "New Sales",
                    "values": [
                        ["2014-10-01T00:00:00Z", 0],
                        ["2014-11-01T00:00:00Z", 0],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 0],
                        ["2015-02-01T00:00:00Z", 0],
                        ["2015-03-01T00:00:00Z", 0],
                        ["2015-04-01T00:00:00Z", 0],
                        ["2015-05-01T00:00:00Z", 0],
                        ["2015-06-01T00:00:00Z", 0],
                        ["2015-07-01T00:00:00Z", 0],
                        ["2015-08-01T00:00:00Z", 0],
                        ["2015-08-06T04:59:14.721Z", 0]
                    ]
                },
                {
                    "key": "Churned Sales",
                    "values": [
                        ["2014-10-01T00:00:00Z", 0],
                        ["2014-11-01T00:00:00Z", 0],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 0],
                        ["2015-02-01T00:00:00Z", 0],
                        ["2015-03-01T00:00:00Z", 0],
                        ["2015-04-01T00:00:00Z", 0],
                        ["2015-05-01T00:00:00Z", 0],
                        ["2015-06-01T00:00:00Z", 0],
                        ["2015-07-01T00:00:00Z", 0],
                        ["2015-08-01T00:00:00Z", 0],
                        ["2015-08-06T04:59:14.721Z", 0]
                    ]
                },
                {
                    "key": "Payments",
                    "values": [
                        ["2014-10-01T00:00:00Z", 1787144],
                        ["2014-11-01T00:00:00Z", 3164787],
                        ["2014-12-01T00:00:00Z", 2951505],
                        ["2015-01-01T00:00:00Z", 3408974],
                        ["2015-02-01T00:00:00Z", 4032787],
                        ["2015-03-01T00:00:00Z", 4946328],
                        ["2015-04-01T00:00:00Z", 6911079],
                        ["2015-05-01T00:00:00Z", 9958194],
                        ["2015-06-01T00:00:00Z", 9296138],
                        ["2015-07-01T00:00:00Z", 10299759],
                        ["2015-08-01T00:00:00Z", 9246970],
                        ["2015-08-06T04:59:14.721Z", 12695659]
                    ]
                },
                {
                    "key": "Refunds",
                    "values": [
                        ["2014-10-01T00:00:00Z", 0],
                        ["2014-11-01T00:00:00Z", 0],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 0],
                        ["2015-02-01T00:00:00Z", 0],
                        ["2015-03-01T00:00:00Z", 0],
                        ["2015-04-01T00:00:00Z", 0],
                        ["2015-05-01T00:00:00Z", 0],
                        ["2015-06-01T00:00:00Z", 0],
                        ["2015-07-01T00:00:00Z", 0],
                        ["2015-08-01T00:00:00Z", 0],
                        ["2015-08-06T04:59:14.721Z", 0]
                    ]
                }
            ],
        }
     get N/A N/A self request N/A args kwargs N/A N/A ends_at N/A N/A N/A request GET get ends_at None N/A ends_at N/A N/A ends_at N/A parse_datetime ends_at N/A ends_at N/A datetime_or_now ends_at N/A N/A account_table _ _ N/A aggregate_monthly_transactions N/A self provider N/A Transaction RECEIVABLE account_title Sales from_date ends_at orig orig dest dest N/A N/A _ payment_amounts N/A aggregate_monthly N/A self provider N/A Transaction RECEIVABLE from_date ends_at orig dest dest dest orig_account N/A Transaction BACKLOG orig_organization N/A self provider N/A N/A _ refund_amounts N/A aggregate_monthly N/A self provider N/A Transaction REFUND from_date ends_at orig dest dest dest N/A account_table N/A N/A key values Payments payment_amounts N/A key values Refunds refund_amounts N/A N/A Response N/A title unit scale table Amount $ 0.01 account_table N/A N/A CustomerMetricAPIView N/A ProviderMixin APIView N/A N/A 
    Produce revenue stats

    **Example request**:

    .. sourcecode:: http

        GET /api/metrics/cowork/customers

    **Example response**:

    .. sourcecode:: http

        {
            "title": "Customers"
            "table": [
                {
                    "key": "Total # of Customers",
                    "values": [
                        ["2014-10-01T00:00:00Z", 15],
                        ["2014-11-01T00:00:00Z", 17],
                        ["2014-12-01T00:00:00Z", 19],
                        ["2015-01-01T00:00:00Z", 19],
                        ["2015-02-01T00:00:00Z", 25],
                        ["2015-03-01T00:00:00Z", 29],
                        ["2015-04-01T00:00:00Z", 37],
                        ["2015-05-01T00:00:00Z", 43],
                        ["2015-06-01T00:00:00Z", 46],
                        ["2015-07-01T00:00:00Z", 48],
                        ["2015-08-01T00:00:00Z", 54],
                        ["2015-08-06T05:20:24.537Z", 60]
                    ]
                },
                {
                    "key": "# of new Customers"
                    "values": [
                        ["2014-10-01T00:00:00Z", 2],
                        ["2014-11-01T00:00:00Z", 2],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 6],
                        ["2015-02-01T00:00:00Z", 4],
                        ["2015-03-01T00:00:00Z", 8],
                        ["2015-04-01T00:00:00Z", 6],
                        ["2015-05-01T00:00:00Z", 3],
                        ["2015-06-01T00:00:00Z", 2],
                        ["2015-07-01T00:00:00Z", 6],
                        ["2015-08-01T00:00:00Z", 7],
                        ["2015-08-06T05:20:24.537Z", 0]
                    ]
                },
                {
                    "key": "# of churned Customers"
                    "values": [
                        ["2014-10-01T00:00:00Z", 0],
                        ["2014-11-01T00:00:00Z", 0],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 0],
                        ["2015-02-01T00:00:00Z", 0],
                        ["2015-03-01T00:00:00Z", 0],
                        ["2015-04-01T00:00:00Z", 0],
                        ["2015-05-01T00:00:00Z", 0],
                        ["2015-06-01T00:00:00Z", 0],
                        ["2015-07-01T00:00:00Z", 0],
                        ["2015-08-01T00:00:00Z", 1],
                        ["2015-08-06T05:20:24.537Z", 60]
                    ]
                },
                {
                    "key": "Net New Customers",
                    "values": [
                        ["2014-10-01T00:00:00Z", 2],
                        ["2014-11-01T00:00:00Z", 2],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 6],
                        ["2015-02-01T00:00:00Z", 4],
                        ["2015-03-01T00:00:00Z", 8],
                        ["2015-04-01T00:00:00Z", 6],
                        ["2015-05-01T00:00:00Z", 3],
                        ["2015-06-01T00:00:00Z", 2],
                        ["2015-07-01T00:00:00Z", 6],
                        ["2015-08-01T00:00:00Z", 6],
                        ["2015-08-06T05:20:24.537Z", -60]
                    ]
                }
            ],
            "extra": [
                {
                    "key": "% Customer Churn",
                    "values": [
                        ["2014-10-01T00:00:00Z", 0],
                        ["2014-11-01T00:00:00Z", 0.0],
                        ["2014-12-01T00:00:00Z", 0.0],
                        ["2015-01-01T00:00:00Z", 0.0],
                        ["2015-02-01T00:00:00Z", 0.0],
                        ["2015-03-01T00:00:00Z", 0.0],
                        ["2015-04-01T00:00:00Z", 0.0],
                        ["2015-05-01T00:00:00Z", 0.0],
                        ["2015-06-01T00:00:00Z", 0.0],
                        ["2015-07-01T00:00:00Z", 0.0],
                        ["2015-08-01T00:00:00Z", 2.08],
                        ["2015-08-06T05:20:24.537Z", 111.11]
                    ]
                }
            ]
        }
     get N/A N/A self request N/A args kwargs N/A N/A ends_at N/A N/A N/A request GET get ends_at None N/A ends_at N/A N/A ends_at N/A parse_datetime ends_at N/A ends_at N/A datetime_or_now ends_at N/A account_title Payments N/A account N/A Transaction RECEIVABLE N/A N/A _ customer_table customer_extra N/A aggregate_monthly_transactions N/A self provider account account_title account_title from_date ends_at N/A N/A Response N/A title table extra Customers customer_table customer_extra N/A N/A PlanMetricAPIView N/A ProviderMixin APIView N/A N/A 
    Produce plan stats

    **Example request**:

    .. sourcecode:: http

        GET /api/metrics/cowork/revenue

    **Example response**:

    .. sourcecode:: http

        {
            "title": "Active Subscribers",
            "table": [
                {
                    "is_active": true,
                    "key": "open-space",
                    "location": "/profile/plan/open-space/",
                    "values": [
                        ["2014-09-01T00:00:00Z", 4],
                        ["2014-10-01T00:00:00Z", 5],
                        ["2014-11-01T00:00:00Z", 6],
                        ["2014-12-01T00:00:00Z", 6],
                        ["2015-01-01T00:00:00Z", 6],
                        ["2015-02-01T00:00:00Z", 9],
                        ["2015-03-01T00:00:00Z", 9],
                        ["2015-04-01T00:00:00Z", 9],
                        ["2015-05-01T00:00:00Z", 11],
                        ["2015-06-01T00:00:00Z", 11],
                        ["2015-07-01T00:00:00Z", 14],
                        ["2015-08-01T00:00:00Z", 16],
                        ["2015-08-06T05:37:50.004Z", 16]
                    ]
                },
                {
                    "is_active": true,
                    "key": "open-plus",
                    "location": "/profile/plan/open-plus/",
                    "values": [
                        ["2014-09-01T00:00:00Z", 7],
                        ["2014-10-01T00:00:00Z", 8],
                        ["2014-11-01T00:00:00Z", 9],
                        ["2014-12-01T00:00:00Z", 9],
                        ["2015-01-01T00:00:00Z", 12],
                        ["2015-02-01T00:00:00Z", 13],
                        ["2015-03-01T00:00:00Z", 18],
                        ["2015-04-01T00:00:00Z", 19],
                        ["2015-05-01T00:00:00Z", 19],
                        ["2015-06-01T00:00:00Z", 20],
                        ["2015-07-01T00:00:00Z", 23],
                        ["2015-08-01T00:00:00Z", 25],
                        ["2015-08-06T05:37:50.014Z", 25]
                    ]
                },
                {
                    "is_active": true,
                    "key": "private",
                    "location": "/profile/plan/private/",
                    "values": [
                        ["2014-09-01T00:00:00Z", 3],
                        ["2014-10-01T00:00:00Z", 3],
                        ["2014-11-01T00:00:00Z", 3],
                        ["2014-12-01T00:00:00Z", 3],
                        ["2015-01-01T00:00:00Z", 6],
                        ["2015-02-01T00:00:00Z", 7],
                        ["2015-03-01T00:00:00Z", 10],
                        ["2015-04-01T00:00:00Z", 15],
                        ["2015-05-01T00:00:00Z", 16],
                        ["2015-06-01T00:00:00Z", 17],
                        ["2015-07-01T00:00:00Z", 17],
                        ["2015-08-01T00:00:00Z", 18],
                        ["2015-08-06T05:37:50.023Z", 18]
                    ]
                }
            ],
            "extra": [
                {
                    "key": "churn",
                    "values": [
                        ["2014-09-01T00:00:00Z", 0],
                        ["2014-10-01T00:00:00Z", 0],
                        ["2014-11-01T00:00:00Z", 0],
                        ["2014-12-01T00:00:00Z", 0],
                        ["2015-01-01T00:00:00Z", 0],
                        ["2015-02-01T00:00:00Z", 0],
                        ["2015-03-01T00:00:00Z", 0],
                        ["2015-04-01T00:00:00Z", 0],
                        ["2015-05-01T00:00:00Z", 0],
                        ["2015-06-01T00:00:00Z", 0],
                        ["2015-07-01T00:00:00Z", 0],
                        ["2015-08-01T00:00:00Z", 1],
                        ["2015-08-06T05:37:50.031Z", 1]
                    ]
                }
            ]
        }
     get N/A N/A self request N/A args kwargs N/A N/A ends_at N/A N/A N/A request GET get ends_at None N/A ends_at N/A N/A ends_at N/A parse_datetime ends_at N/A ends_at N/A datetime_or_now ends_at N/A table N/A N/A plan N/A N/A N/A Plan objects filter organization N/A self provider N/A N/A values N/A active_subscribers plan from_date N/A N/A N/A self kwargs get from_date N/A N/A N/A table append N/A key values location is_active N/A plan slug values N/A reverse saas_plan_edit args N/A N/A self provider plan N/A plan is_active N/A extra N/A N/A key values churn N/A churn_subscribers from_date N/A N/A N/A self kwargs get from_date N/A N/A Response N/A title table extra Active Subscribers table extra N/A N/A OrganizationListAPIView N/A ProviderMixin GenericAPIView N/A N/A model Organization N/A serializer_class OrganizationSerializer get N/A N/A self request N/A args kwargs N/A N/A start_at N/A N/A N/A request GET get start_at None N/A start_at N/A N/A start_at N/A parse_datetime start_at N/A start_at N/A datetime_or_now start_at N/A ends_at N/A N/A N/A request GET get ends_at None N/A ends_at N/A N/A ends_at N/A parse_datetime ends_at N/A ends_at N/A datetime_or_now ends_at N/A queryset N/A N/A self get_range_queryset start_at ends_at N/A page_object_list N/A N/A self paginate_queryset queryset N/A serializer N/A N/A self serializer_class N/A N/A Response N/A start_at ends_at count N/A self queryset_name start_at ends_at N/A N/A queryset count N/A N/A N/A serializer to_representation organization N/A organization page_object_list N/A N/A