def link_all_other_oils(session):
'''
Category Name:
- Other
Sample Oils:
- Catalytic Cracked Slurry Oil
- Fluid Catalytic Cracker Medium Cycle Oil
Criteria:
- Any oils that fell outside all the other Category Criteria
'''
_top, categories = get_categories_by_names(session, 'Other',
('Other',))
oils = (session.query(Oil)
.filter(Oil.categories == None)
.all())
count = 0
for o in oils:
o.categories.extend(categories)
count += 1
logger.info('{0} oils added to {1}.'
.format(count, [n.name for n in categories]))
transaction.commit()
评论列表
文章目录