If I understand correctly, I think something like the following would do what you're asking about.
import django.apps
models = django.apps.apps.get_models()
for model in models:
field_names = [f.attname for f in model._meta.get_fields()]
for fields in model.objects.values_list(*field_names):
do_something_with_the_fields(fields)
This seems like an odd thing to want Django to do for you. What are you trying to accomplish by getting all the tables and field names django is aware of?
Edit based on further explanation in comments
To dump a table all columns of a table to a CSV, it's probably easiest to introspect the cursor's returned column metadata from the database. There's not much reason to use Django's model definitions in this case:
import csv
from django.db import connection
def dump_table_to_csv(db_table, io):
with connection.cursor() as cursor:
cursor.execute("SELECT * FROM %s" % db_table, [])
rows = cursor.fetchall()
writer = csv.writer(io)
writer.writerow([i[0] for i in cursor.description]) # http://stackoverflow.com/a/9752485
for row in rows:
writer.writerow(row)
witb open('path/to/myfile.csv', 'wb') as f:
dump_table_to_csv(django_model._meta.db_table, f)