Question: suppose I have the following three models, see as follow: I wanna to construct a Django model query to archive the same effect as the following SQL statement.

**SQL statement**

```
select B.value, C.special
from B inner join C 
where B.version = C.version and B.order = C.order;

```

I got the following three models:

```
class Process(models.Model):
    name = models.CharField(max_length=30)
    description = models.CharField(max_length=150)

class ProcessStep(models.Model):
    process = models.ForeignKey(Process)
    name = models.CharField(max_length=30)
    ...
    order = models.SmallIntegerField(default=1)
    version = models.SmallIntegerField(null=True)

class Approve(models.Model):
    process = models.ForeignKey(Process)
    content = models.CharField(max_length=300)
    ...
    version = models.SmallIntegerField(null=True)
    order = models.SmallIntegerField(default=0)

```

I want to find all Approves that have the same (version, order) tuple matching against the ProcessStep model.

Answer: 
You can combine the usage of [zip()](https://docs.python.org/3/library/functions.html#zip) with [tabulate](https://pypi.python.org/pypi/tabulate) to create a nicer looking table:

```python
from tabulate import tabulate
headers = ['planet', 'amp', 'mass', 'period', 'ecc']    

amp = [1.1, 1.2, 1.3, 1.4]
mass = [2.1, 2.2, 2.3, 2.4]
period = [3.1, 3.2, 3.3, 3.4]
ecc = [4.1, 4.2, 4.3, 4.4]
planet = range(1, len(amp)+1)

table = zip(planet, amp, mass, period, ecc)
print(tabulate(table, headers=headers, floatfmt=".4f"))

```

Output:
-------

```none
  planet     amp    mass    period     ecc
--------  ------  ------  --------  ------
       1  1.1000  2.1000    3.1000  4.1000
       2  1.2000  2.2000    3.2000  4.2000
       3  1.3000  2.3000    3.3000  4.3000
       4  1.4000  2.4000    3.4000  4.4000

```
You can use `\t`.

For example:

```
print 'a\t','b\t','\n','c\t','d\t'

```

output:

```
a   b   
c   d   

```