EdinburghGenomics / pyclarity-lims

Python interface to the GenoLogics LIMS server via its REST API.
MIT License
11 stars 4 forks source link

Lims.put_batch does not support batch file updates. #34

Closed jonathandixon closed 5 years ago

jonathandixon commented 6 years ago

Calling lims.get_batch(files) produces the following error:

  File "/usr/lib/python2.6/site-packages/pyclarity_lims/lims.py", line 660, in put_batch
    uri = self.get_uri(klass._URI, 'batch/update')
  File "/usr/lib/python2.6/site-packages/pyclarity_lims/lims.py", line 78, in get_uri
    url = urljoin(self.baseuri, '/'.join(segments))
TypeError: sequence item 2: expected string, NoneType found

It looks like this would be as simple as adding _URI and _PREFIX to the File class.

class File(Entity):
    """File attached to a project or a sample."""
    _URI = 'files'
    _PREFIX = 'file'

The benefit of supporting this operation is to batch update the is_published property of files.