Example #1
0
  def _updateField(self, entity, entity_properties, name):
    """Special logic for role. If state changes to active we flush the sidebar.
    """
    value = entity_properties[name]

    
    if (name == 'is_featured') and (entity.is_featured != value):
      sidebar.flush()

    home_for = entity.home_for

    if (name != 'home_for') and home_for:
      home.flush(home_for)

    return True
Example #2
0
  def _updateField(self, entity, entity_properties, name):
    """Special logic for Document.

    - Flush the sidebar when a document is featured.
    - Remove the document from the homepage cache when the home_for is updated
    """

    value = entity_properties[name]

    if (name == 'is_featured') and (entity.is_featured != value):
      sidebar.flush()

    home_for = entity.home_for

    if (name != 'home_for') and home_for:
      home.flush(home_for)

    return True