from .tools import to_datetime


class Task(object):
    """
        Feel free to use these attributes:
        highrise_id
        recording-id
        subject-id
        subject-type
        category-id
        body
        frame
        due-at
        alert-at
        created-at
        author-id
        updated-at
        public
        recording-id
        subject-id
        subject-type
        category-id
        body
        frame
        due-at
        alert-at
        created-at
        author-id
        updated-at
        public
    """

    def save_data(self, task):
        self.highrise_id = task['id'].pyval
        self.created_at = to_datetime(task['created-at'].pyval)
        self.updated_at = to_datetime(task['updated-at'].pyval)
        self.due_at = to_datetime(task['due-at'].pyval)
        self.alert_at = to_datetime(task['alert-at'].pyval)

        for attr in [
            'recording-id',
            'subject-id',
            'subject-type',
            'category-id',
            'body',
            'frame',
            'author-id',
            'public',
            'recording-id',
            'subject-id',
            'subject-type',
            'category-id',
            'body',
            'frame',
            'due-at',
            'alert-at',
            'created-at',
            'author-id',
            'updated-at',
            'public']:
            setattr(self, attr.replace('-', '_'), task[attr].pyval)

@@ -1254,138 +1254,49 @@
    '
-due-at',%0A            'alert-at',%0A            'created-at',%0A            'author-id',%0A            'updated-at',%0A            'public'
+author-id',%0A            'public'%0A        
 %5D:%0A 

Remove the override