app/soc/logic/models/review.py
changeset 1740 fbc2ad561c4b
parent 1710 9003103d01a1
child 1757 0f909179ccf2
equal deleted inserted replaced
1739:19f1bb7ae615 1740:fbc2ad561c4b
    40     """
    40     """
    41 
    41 
    42     super(Logic, self).__init__(model=model, base_model=base_model,
    42     super(Logic, self).__init__(model=model, base_model=base_model,
    43                                 scope_logic=scope_logic)
    43                                 scope_logic=scope_logic)
    44 
    44 
       
    45   def getReviewsForEntity(self, entity, is_public, order=None):
       
    46     """Returns the reviews that have the given entity as scope.
       
    47     
       
    48     Args:
       
    49       entity: the entity which is the scope of the review
       
    50       is_public: determines if the public or non-public reviews are returned
       
    51       order: the optional ordering in which the reviews are returned
       
    52     """
       
    53 
       
    54     fields = {'scope': entity,
       
    55               'is_public': is_public}
       
    56 
       
    57     query = self.getQueryForFields(fields, order)
       
    58 
       
    59     return self.getAll(query)
       
    60 
    45 logic = Logic()
    61 logic = Logic()