manage.py: better output for list data sources command

This commit is contained in:
Arik Fraimovich 2014-11-04 07:26:32 +02:00
parent db7a287e82
commit 86e6798c96

View File

@ -180,8 +180,12 @@ def import_from_settings(name=None):
@data_sources_manager.command
def list():
"""List currently configured data sources"""
for ds in models.DataSource.select():
print "Name: {}\nType: {}\nOptions: {}".format(ds.name, ds.type, ds.options)
for i, ds in enumerate(models.DataSource.select()):
if i > 0:
print "-"*20
print "Id: {}\nName: {}\nType: {}\nOptions: {}".format(ds.id, ds.name, ds.type, ds.options)
@data_sources_manager.command
def new(name, type, options):