Skip to content

Commit

Permalink
Merge pull request #166 from loechel/patch-1
Browse files Browse the repository at this point in the history
Update time_entry.rst to fix doc issue 165
  • Loading branch information
maxtepkeev committed Mar 2, 2017
2 parents 788a41a + 6775f81 commit af97ac7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/resources/time_entry.rst
Expand Up @@ -23,8 +23,9 @@ create
Creates new time entry resource with given fields and saves it to the Redmine.

:param integer issue_id or project_id: (required). The issue id or project id to log time on.
:param integer hours: (required). The number of spent hours.
:param hours: (required). The number of spent hours.
:param spent_on: (optional). The date the time was spent (current date if not set).
:type hours: int or float
:type spent_on: string or date object
:param integer activity_id: (optional). The id of the time activity. This parameter is required unless
a default activity is defined in Redmine.
Expand All @@ -33,7 +34,7 @@ create

.. code-block:: python
>>> time_entry = redmine.time_entry.create(issue_id=123, spent_on='2014-01-14', hours=3, activity_id=10, comments='hello')
>>> time_entry = redmine.time_entry.create(issue_id=123, spent_on='2014-01-14', hours=3.5, activity_id=10, comments='hello')
>>> time_entry
<redmine.resources.TimeEntry #12345>
Expand All @@ -55,7 +56,7 @@ new
>>> time_entry = redmine.time_entry.new()
>>> time_entry.issue_id = 123
>>> time_entry.spent_on = date(2014, 1, 14)
>>> time_entry.hours = 3
>>> time_entry.hours = 3.5
>>> time_entry.activity_id = 10
>>> time_entry.comments = 'hello'
>>> time_entry.save()
Expand Down Expand Up @@ -157,16 +158,17 @@ update

:param integer resource_id: (required). Time entry id.
:param integer issue_id or project_id: (optional). The issue id or project id to log time on.
:param integer hours: (optional). The number of spent hours.
:param hours: (optional). The number of spent hours.
:param spent_on: (optional). The date the time was spent.
:type hours: int or float
:type spent_on: string or date object
:param integer activity_id: (optional). The id of the time activity.
:param string comments: (optional). Short description for the entry (255 characters max).
:return: True

.. code-block:: python
>>> redmine.time_entry.update(1, issue_id=123, spent_on='2014-01-14', hours=3, activity_id=10, comments='hello')
>>> redmine.time_entry.update(1, issue_id=123, spent_on='2014-01-14', hours=3.5, activity_id=10, comments='hello')
True
save
Expand All @@ -186,7 +188,7 @@ save
>>> time_entry = redmine.time_entry.get(1)
>>> time_entry.issue_id = 123
>>> time_entry.spent_on = date(2014, 1, 14)
>>> time_entry.hours = 3
>>> time_entry.hours = 3.5
>>> time_entry.activity_id = 10
>>> time_entry.comments = 'hello'
>>> time_entry.save()
Expand Down

0 comments on commit af97ac7

Please sign in to comment.