app/soc/logic/models/survey.py
changeset 2684 08ec7ca16dce
parent 2590 f0d0c9e7b2d4
child 2689 18d8486fd411
equal deleted inserted replaced
2683:8ea17736a10d 2684:08ec7ca16dce
   344     entity.put()
   344     entity.put()
   345 
   345 
   346     # return the scope
   346     # return the scope
   347     return entity.scope
   347     return entity.scope
   348 
   348 
       
   349   def hasAtLeastOneRecord(self, survey_entity):
       
   350     """Returns True iff the given Survey has at least one SurveyRecord.
       
   351 
       
   352     Args:
       
   353       survey_entity: a Survey instance
       
   354     """
       
   355 
       
   356     fields = {'survey': survey_entity}
       
   357 
       
   358     record_logic = self.getRecordLogic()
       
   359     return record_logic.getQueryForFields(fields).count(1) > 0
       
   360 
   349   def _onCreate(self, entity):
   361   def _onCreate(self, entity):
   350     """Set the scope of the survey.
   362     """Set the scope of the survey.
   351     """
   363     """
   352 
   364 
   353     self.getScope(entity)
   365     self.getScope(entity)