Skip to content

Commit

Permalink
Add clear_documents() and add_documents() to be publicly exposed
Browse files Browse the repository at this point in the history
  • Loading branch information
duckduckgrayduck authored Nov 5, 2023
1 parent c572272 commit da88feb
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions docs/projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,34 @@ Project
>>> obj.title = "Brand new title"
>>> obj.put()

.. method:: save()

An alias for :meth:`put` that saves changes back to DocumentCloud.

.. method:: delete()

Delete a project from DocumentCloud. You must be authorized to make these
changes. ::

>>> obj = client.projects.get('816')
>>> obj.delete()
.. method:: clear_documents()

.. method:: save()
Removes all documents from a project.

An alias for :meth:`put` that saves changes back to DocumentCloud.
>>> obj = client.projects.get('816')
>>> obj.clear_documents()

.. method:: add_documents()

Efficiently adds a lot of documents to a project.
Adds the documents 25 at a time using bulk API calls.

>>> documents_to_add = [client.documents.get('23745990'), client.documents.get('23745988')]
>>> obj = client.projects.get('816')
>>> obj.add_documents(documents_to_add)
>>> obj.put()

.. attribute:: created_at

Expand Down

0 comments on commit da88feb

Please sign in to comment.