Changing TaskHistory from Model to property(Forgot to make the change in previous commit). Changed to Task Model properties

git-svn-id: http://soc.googlecode.com/svn/wiki@3224 5fae56a1-394a-0410-ba46-5107137fd53f
diff --git a/GHOPImplementationDesign.wiki b/GHOPImplementationDesign.wiki
index eb054ca..bce7913 100644
--- a/GHOPImplementationDesign.wiki
+++ b/GHOPImplementationDesign.wiki
@@ -139,77 +139,54 @@
   * difficulty - *StringProperty* (Pre-defined by Program Administrator in the Program Configuration Page)
   * state - *StringProperty*
     ** Each task should have one of the following task statuses:
-         ** Approved: If task is created by mentor, this is the automatically assigned state,
+         ** Unapproved: If task is created by mentor, this is the automatically assigned state,
          ** Unpublished: This task is not published yet,
          ** Open: This task has not yet been claimed,
          ** Reopened: This task has been claimed but never finished and has been reopened,
+         ** Claimrequested: This task has been requested to be claimed by a student,
          ** Claimed: This task has been claimed and someone is working on it,
          ** ActionNeeded: Work on this task must be submitted for review within 24 hours,
          ** Closed: Work on this task has been successfully completed. 
+         ** AwaitingRegistration: Student has completed work on this task, but needs to complete student registration before this task is closed.
     ** additional states need polishing/review with legal
          ** NeedsWork: This task is nearly there, but a bit more must be accomplished. (following mentor review)
-         ** NeedsReview: Student has submitted work for this task and it should be reviewed. 
-  * type - *StringProperty*
+         ** NeedsReview: Student has submitted work for this task and it should be reviewed.
+  * type - *StringListProperty*
+  * was_reopned - *BooleanProperty* (Stores if task was reopened. Helpful when task is reclaimed
   * time_to_complete - *IntegerProperty* (Time allowed for completing the task (in hours) from the moment that this task has been assigned to a student.)
   * deadline - *DateTimeProperty* (Once the project is set to be "Claimed" we calculate and store this property in the entity)
+  * tags - *StringListProperty* (Pending on conclusion on tags)
   * created_by - *ReferenceProperty(Role)*
   * edited_by - *ReferenceProperty(Role)* (Changes only when OA/Mentor change title/description, difficulty, type, time-to-complete only)
   * created_on - *DateTimeProperty*
   * edited_on - *DateTimeProperty*
+  * history - *TextProperty*
   
-== TaskHistory ==
-Lennie: This is what I meant by "snapshot of the task at particular instance of time". It can be handled in one of the 2 ways, either store all the property values as it at the moment when one or more values change or just store the value of the property that changes at that time instance before the value was changed and along with that store the timestamp. 
-You had suggested to store a single change is single property and parse the property value to retrive that history.
+Task history is stored as JSON string. At the top level it is a dictionary with key being the timestamp and value being another dictionay containing the changes. `_`onCreate() it stores the snapshot of the entire task as it was when it was created with all properties in it. Upon each change a new dictionary item will be created with key being timestamp when the Task entity change was triggered. The value for this item will be a dictionary with key fields being the name of the property that changed and its value being the changed value.
 
-I had a small discussion with Sverre about Datastore storage space consumption on the kind of model I am proposing. The logs are here:
-[http://www.thousandparsec.com/~irc/logm/%23melange.2009-05-15.log.html#t2009-05-15T08:38:33 start]
-[http://www.thousandparsec.com/~irc/logm/%23melange.2009-05-15.log.html#t2009-05-15T08:52:14 end]
-
-  * _task_
-  * _user_
-  * _student_
-  * _organization_    
-  * title
-  * description
-  * difficulty 
-  * state
-  * type
-  * time_to_complete
-  * deadline
-  * created_by
-  * edited_by
-  * created_on
-  * edited_on
-  * timestamp - *DateTimeProperty* 
-
-Explanation: Say suppose at this time instance we have a Task entity with the following values:
-  * user: "reference to madhu's user model entity"
-  * student: "reference to madhu's student model entity"
-  * title: "Melange's easiest task"
-  * ...
-  * state: 'Claimed'
-  * ...
-
-Madhu completes his work and marks it as 'NeedsReview' at 20:00HRS November 19th, 2009. The task entity changes to 
-  * user: "reference to madhu's user model entity"
-  * student: "reference to madhu's student model entity"
-  * title: "Melange's easiest task"
-  * ...
-  * state: 'NeedsReview'
-  * ...
-
-When this change in the Task entity occurs we create a new TaskHistory entity with the following values:
-  * task: "reference to the task titled 'Melange's easiest task'"
-  * user: "reference to madhu's user model entity"
-  * student: "reference to madhu's student model entity"
-  * ...
-  * state: 'Claimed'
-  * ...
-  * timestamp: 2000 November 19th, 2009 as a *DateTimeProperty*
-<madhu>
-I am really concerned about the storage space this kind of a model would consume in the datastore.
-</madhu>
-
+Sample JSON Object:
+{
+  "1242938868": {
+      "user": "madhusudancs"
+      "student": "madhu"
+      "organization": "melange"
+      "mentors": ["lennard", "pawel"]
+      "title": "GHOP test task"
+      "description": "This is an awesome task. Work on it and win a prize!"
+      "difficulty": "easy"
+      "state": "ToBeApproved"
+      "type": "Documentation"
+      "time_to_complete": 48
+      "deadline": 
+      "created_by": "paul"
+      "edited_by": "paul"
+      "created_on": 1242938868
+      "edited_on": 1242938868
+    }
+   "1242939222": {
+      "state": "Open"
+   }
+}
 
 The following models are shared models with GSoC with different OOP. Look at Module Architecture.
 == Organization ==