currently, data to be read by reader is passed to the reader's constructor, making it a one use container, and also making the inputs difficult to manage.
For example, in the DjangoModelReader we don't really need parameters, which is the only input required by a reader, so it would be nice to default it to None, but since the model_instance argument is second, is required, so wouldn't make sense to give it a default, or pass as keyword arg, then we're stuck doing this:
datsrc = DjangoModelReader(None, mymodel)
Instead, don't pass the data to the constructor, just pass it to the reader's load_data() call, which is used in DataSource.
currently, data to be read by reader is passed to the reader's constructor, making it a one use container, and also making the inputs difficult to manage.
For example, in the
DjangoModelReader
we don't really need parameters, which is the only input required by a reader, so it would be nice to default it toNone
, but since themodel_instance
argument is second, is required, so wouldn't make sense to give it a default, or pass as keyword arg, then we're stuck doing this:Instead, don't pass the data to the constructor, just pass it to the reader's
load_data()
call, which is used inDataSource
.