app/soc/modules/ghop/logic/models/task.py
changeset 3059 14421976288a
parent 2979 ba4aeaaad0a1
child 3080 30a33926ab91
equal deleted inserted replaced
3058:5395772146cc 3059:14421976288a
   158       comment_properties: keyword arguments that correspond to the
   158       comment_properties: keyword arguments that correspond to the
   159           GHOPTask's to be created comment entity
   159           GHOPTask's to be created comment entity
   160       silent: iff True does not call post store methods.
   160       silent: iff True does not call post store methods.
   161     """
   161     """
   162 
   162 
   163     from soc.modules.ghop.logic.models import comment as ghop_comment_logic
   163     from soc.modules.ghop.logic.models.comment import logic as \
   164     from soc.modules.ghop.logic.models import work_submission as \
   164         ghop_comment_logic
       
   165     from soc.modules.ghop.logic.models.work_submission import logic as \
   165         ghop_work_submission_logic
   166         ghop_work_submission_logic
   166     from soc.modules.ghop.models import comment as ghop_comment_model
   167     from soc.modules.ghop.models import comment as ghop_comment_model
   167     from soc.modules.ghop.models import work_submission as \
   168     from soc.modules.ghop.models import work_submission as \
   168         ghop_work_submission_model
   169         ghop_work_submission_model
   169 
   170 
   197         comment_create)
   198         comment_create)
   198 
   199 
   199     if not silent:
   200     if not silent:
   200       # call the _onCreate methods for the Comment and WorkSubmission
   201       # call the _onCreate methods for the Comment and WorkSubmission
   201       if comment_entity:
   202       if comment_entity:
   202         ghop_comment_logic.logic._onCreate(comment_entity)
   203         ghop_comment_logic._onCreate(comment_entity)
   203 
   204 
   204       if ws_entity:
   205       if ws_entity:
   205         ghop_work_submission_logic._onCreate(ws_entity)
   206         ghop_work_submission_logic._onCreate(ws_entity)
   206 
   207 
   207     return entity, comment_entity, ws_entity
   208     return entity, comment_entity, ws_entity
   260     specified by the fields argument.
   261     specified by the fields argument.
   261 
   262 
   262     For args see base.getFromKeyFieldsOr404().
   263     For args see base.getFromKeyFieldsOr404().
   263     """
   264     """
   264 
   265 
   265     from soc.modules.ghop.logic.models import comment as ghop_comment_logic
   266     from soc.modules.ghop.logic.models.comment import logic as \
   266     from soc.modules.ghop.logic.models import work_submission as \
   267         ghop_comment_logic
       
   268     from soc.modules.ghop.logic.models.work_submission import logic as \
   267         ghop_work_submission_logic
   269         ghop_work_submission_logic
   268  
   270  
   269     entity = self.getFromKeyFieldsOr404(fields)
   271     entity = self.getFromKeyFieldsOr404(fields)
   270 
   272 
   271     comment_entities = ghop_comment_logic.logic.getForFields(
   273     comment_entities = ghop_comment_logic.getForFields(
   272         ancestors=[entity], order=['created_on'])
   274         ancestors=[entity], order=['created_on'])
   273 
   275 
   274     ws_entities = ghop_work_submission_logic.logic.getForFields(
   276     ws_entities = ghop_work_submission_logic.getForFields(
   275         ancestors=[entity], order=['submitted_on'])
   277         ancestors=[entity], order=['submitted_on'])
   276 
   278 
   277     return entity, comment_entities, ws_entities
   279     return entity, comment_entities, ws_entities
   278 
   280 
   279   def updateTaskStatus(self, entity):
   281   def updateTaskStatus(self, entity):