title: Python Cubes OLAP Framework - how to work with joins?
body: <p>I'm trying to use python's olap framework <a href="http://packages.python.org/cubes/" rel="noreferrer">cubes</a> on a very simple database, but I am having some trouble joining tables.</p>
  
  <p>My schema looks like this:</p>
  
  <pre><code>Users table
  ID | name
  
  Products table
  ID | name | price
  
  Purchases table
  ID | user_id | product_id | date
  </code></pre>
  
  <p>And the cubes model:</p>
  
  <pre><code>{
      'dimensions': [
          {'name': 'user_id'},
          {'name': 'product_id'},
          {'name': 'date'},
      ],
      'cubes': [
          {
              'name': 'purchases',
              'dimensions': ['user_id', 'product_id', 'date'],
              'measures': ['price']
              'mappings': {
                  'purchases.user_id': 'users.id',
                  'purchases.product_id': 'products.id',
                  'purchases.price': 'products.price'
              },
              'joins': [
                  {
                      'master': 'purchases.user_id',
                      'detail': 'users.id'
                  },
                  {
                      'master': 'purchases.product_id',
                      'detail': 'products.id'
                  }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>Now I would like to display all the purchases, showing the product's name, user's name and purchase date. I can't seem to find a way to do this. The documentation is a bit scarce.</p>
  
  <p>Thank you</p>