redcap-tools / PyCap

REDCap in Python
http://redcap-tools.github.io/PyCap/
MIT License
169 stars 80 forks source link

Coerce argument types for forms/fields in export_records #262

Closed pwildenhain closed 1 year ago

pwildenhain commented 1 year ago

Right now passing a string will give really weird behavior, but should actually be fine. If the user passes a string, we should coerce it to a list for them, rather than try to iterate over a string (which will produce weird error messages)

ugGit commented 1 year ago

Hi Paul

Am I understanding this issue right, that you just want to include in records.py something like:

if isinstance(str, forms):
  forms = [forms]

If so, I'll make you a PR with the according change. Else, feel free to elaborate your implementation suggestion more in detail.

pwildenhain commented 1 year ago

That would be great! If you could do this for forms and fields that would be 👌🏻