Exemple #1
0
 def export_categ(self, user):
     expInt = CategoryEventFetcher(user, self)
     id_list = set(self._idList)
     if self._wantFavorites and user:
         id_list.update(str(c.id) for c in user.favorite_categories)
     legacy_id_map = {m.legacy_category_id: m.category_id
                      for m in LegacyCategoryMapping.find(LegacyCategoryMapping.legacy_category_id.in_(id_list))}
     id_list = {str(legacy_id_map.get(id_, id_)) for id_ in id_list}
     return expInt.category(id_list, self._format)
Exemple #2
0
def _category_deleted(category, **kwargs):
    if hasattr(category, '_old_id'):
        LegacyCategoryMapping.find(
            legacy_category_id=category._old_id).delete()
Exemple #3
0
def _category_deleted(category, **kwargs):
    if hasattr(category, '_old_id'):
        LegacyCategoryMapping.find(legacy_category_id=category._old_id).delete()