def clear_entries(options):
 with Session() as session:
  query = session.query(PendingEntry).filter((PendingEntry.approved == False))
  if options.task_name:
   query = query.filter((PendingEntry.task_name == options.task_name))
  deleted = query.delete()
  console((u'Successfully deleted %i pending entries' % deleted))

def clear_entries ( options ) : with Session ( ) as session : query = session . query ( PendingEntry ) . filter ( ( PendingEntry . approved == False ) ) if options . task_name : query = query . filter ( ( PendingEntry . task_name == options . task_name ) ) deleted = query . delete ( ) console ( ( u'Successfully deleted %i pending entries' % deleted ) )
clear pending entries .