Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213
  1. def split_by_position(linked_promotions, context):
  2. """
  3. Split the list of promotions into separate lists, grouping
  4. by position, and write these lists to the passed context.
  5. """
  6. for linked_promotion in linked_promotions:
  7. promotion = linked_promotion.content_object
  8. if not promotion:
  9. continue
  10. key = 'promotions_%s' % linked_promotion.position.lower()
  11. if key not in context:
  12. context[key] = []
  13. context[key].append(promotion)