From 1522e0b0573f4b35798deaa709821c9a258ed48a Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Wed, 1 Mar 2017 00:43:53 +0100 Subject: [PATCH 1/3] Update time_entry.rst to fix doc issue 165 the hour param should be float, I do not see any limitaion on that and Redmien takes floats for the time entries. Addusted also doctests to test and reflect changes --- docs/resources/time_entry.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/resources/time_entry.rst b/docs/resources/time_entry.rst index 971e4db..77e7606 100644 --- a/docs/resources/time_entry.rst +++ b/docs/resources/time_entry.rst @@ -23,7 +23,7 @@ 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 float hours: (required). The number of spent hours. :param spent_on: (optional). The date the time was spent (current date if not set). :type spent_on: string or date object :param integer activity_id: (optional). The id of the time activity. This parameter is required unless @@ -33,7 +33,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 @@ -55,7 +55,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() @@ -157,7 +157,7 @@ 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 float hours: (optional). The number of spent hours. :param spent_on: (optional). The date the time was spent. :type spent_on: string or date object :param integer activity_id: (optional). The id of the time activity. @@ -166,7 +166,7 @@ update .. 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 @@ -186,7 +186,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() From de7eb5927297b804681ac1b5db1b34508cb3fce4 Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Thu, 2 Mar 2017 00:17:52 +0100 Subject: [PATCH 2/3] set to integer or float --- docs/resources/time_entry.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resources/time_entry.rst b/docs/resources/time_entry.rst index 77e7606..81afa26 100644 --- a/docs/resources/time_entry.rst +++ b/docs/resources/time_entry.rst @@ -23,7 +23,7 @@ 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 float hours: (required). The number of spent hours. + :param integer or float hours: (required). The number of spent hours. :param spent_on: (optional). The date the time was spent (current date if not set). :type spent_on: string or date object :param integer activity_id: (optional). The id of the time activity. This parameter is required unless @@ -157,7 +157,7 @@ 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 float hours: (optional). The number of spent hours. + :param integer or float hours: (optional). The number of spent hours. :param spent_on: (optional). The date the time was spent. :type spent_on: string or date object :param integer activity_id: (optional). The id of the time activity. From 6775f81ab2a52235bbf23711a8bf90458aaf70bb Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Thu, 2 Mar 2017 09:56:14 +0100 Subject: [PATCH 3/3] moved int or fload to :type hours: element --- docs/resources/time_entry.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/resources/time_entry.rst b/docs/resources/time_entry.rst index 81afa26..5a51179 100644 --- a/docs/resources/time_entry.rst +++ b/docs/resources/time_entry.rst @@ -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 or float 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. @@ -157,8 +158,9 @@ 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 or float 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).