News

Supported by Redmine starting from version 1.1

Manager

All operations on the News resource are provided by it’s manager. To get access to it you have to call redmine.news where redmine is a configured redmine object. See the Configuration about how to configure redmine object.

Create methods

Not supported by Redmine

Read methods

get

Not supported by Redmine

all

redminelib.managers.ResourceManager.all(**params)

Returns all News resources from Redmine.

Parameters:
  • limit (int) – (optional). How much resources to return.
  • offset (int) – (optional). Starting from what resource to return the other resources.
Returns:

ResourceSet object

>>> news = redmine.news.all(offset=10, limit=100)
>>> news
<redminelib.resultsets.ResourceSet object with News resources>

filter

redminelib.managers.ResourceManager.filter(**filters)

Returns News resources that match the given lookup parameters.

Parameters:
  • project_id (int or string) – (required). Id or identifier of news project.
  • limit (int) – (optional). How much resources to return.
  • offset (int) – (optional). Starting from what resource to return the other resources.
Returns:

ResourceSet object

>>> news = redmine.news.filter(project_id='vacation')
>>> news
<redminelib.resultsets.ResourceSet object with News resources>

Hint

You can also get news from a Project resource object directly using news relation:

>>> project = redmine.project.get('vacation')
>>> project.news
<redminelib.resultsets.ResourceSet object with News resources>

Update methods

Not supported by Redmine

Delete methods

Not supported by Redmine

Export

New in version 2.0.0.

redminelib.resultsets.ResourceSet.export(fmt, savepath=None, filename=None)

Exports a resource set of News resources in one of the following formats: atom

Parameters:
  • fmt (string) – (required). Format to use for export.
  • savepath (string) – (optional). Path where to save the file.
  • filename (string) – (optional). Name that will be used for the file.
Returns:

String or Object

>>> news = redmine.news.all()
>>> news.export('atom', savepath='/home/jsmith', filename='news.atom')
'/home/jsmith/news.atom'